The default postgresql connection pool size of mapnik is 10, which can get exhausted
on modern multi-core servers.
This sets the max_size parameter to 2 larger than the thread count unless it is
explicitly set in the loaded stylesheet.
While mod_tile could handle much higher zoom levels already, renderd was stuck with z18,
unless one changed the compile time setting.
This changes the maximum supported zoom level to z20 out of the box. Furthermore,
it is now possible to set max and min zoom level per style in renderd.conf (as long
as they are within the range.)
Zoom levels higher than z20 are currently not supported out of the box, especially with
the file based storage backend. The directory hash function only supports 40 bit (20 bit for each X and Y).
It assumes that one doesn't set an explicity buffer_size of 0 and thus
all buffer_sizes are the default for which renderd then overwrites it to
buffer_size 128.
Addresses issue #17
Apache's memory pool operations aren't thread-safe. In get_storage_backend
multiple threads could try to allocate memory on the process pool concurrently
leading to segfaults. To prevent this, wrap that code into a mutex.
Benchmarking seems to indicate, that even though each request has to acquire the lock
this does not appear to have a performance impact.
The issue was reported by Sven Geggus, and diagnosed by Tom Hughes. Thanks.
Also make a slightly cleaner extraction.
This hopefully has a couple of advantages:
1) The code should now be a bit cleaner
2) It makes testing the queueing code easier
3) In future it might be possible to have a separate queue per style
allowing e.g. to perform fair queueing between styles.
add test framework that can be run with 'make test' - refs #10
This still needs some more cleanup to get it working, but as it doesn't effect anything existing, I'll do that post merge.
Also work around a bug in cairomm flags in Mapnik 2.0 (#787) that has been fixed upstream
a long time ago, but is still present in the ubuntu mapnik packages.