[MapProxy] PostgreSQL connection pooling with Mapnik source

Jeremy Palmer JPalmer at linz.govt.nz
Thu Nov 3 17:38:23 PDT 2016

Hi Travis,

On 4/11/2016, at 9:19 AM, Travis Kirstine <traviskirstine at gmail.com<mailto:traviskirstine at gmail.com>> wrote:

I'm not sure how mapnik handles the connection pooling, we use mapserver however I know that mapserver only reuses the connection once per map render (reuse it for each layer defined but close it after image is rendered).

My understanding when using the mapnik python bindings that mapnik internally uses a pool of 10 connections by default per process. This pool is not just for per layer renders, but persists  I also understand that maproxy-seed uses one process per seed worker. Looking at https://github.com/mapproxy/mapproxy/blob/master/mapproxy/source/mapnik.py#L106 it seems like MapProxy is caching mapnik map project objects per process.  So it seems funny that it’s not reusing connections.

You can use a connection pooling middleware to reduce some of the overhead (pgbouncer)  and or increase the metatile size

Yes I had thought about a middleware - I will try this as well, but it still seems funny that it’s no reusing connections.


This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20161104/65d73c31/attachment.html>

More information about the MapProxy mailing list