<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">
<br class="">
</div>
</div>
</div>
Hi Travis,
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 4/11/2016, at 9:19 AM, Travis Kirstine <<a href="mailto:traviskirstine@gmail.com" class="">traviskirstine@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">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). 
</div>
</div>
</blockquote>
<div><br class="">
</div>
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 <a href="https://github.com/mapproxy/mapproxy/blob/master/mapproxy/source/mapnik.py#L106" class="">https://github.com/mapproxy/mapproxy/blob/master/mapproxy/source/mapnik.py#L106</a> it seems like MapProxy is caching mapnik map project objects per
 process.  So it seems funny that it’s not reusing connections.<br class="">
<div><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">You can use a connection pooling middleware to reduce some of the overhead (pgbouncer)  and or increase the metatile size </div>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
</blockquote>
</div>
</div>
</div>
</blockquote>
<br class="">
</div>
<div>Yes I had thought about a middleware - I will try this as well, but it still seems funny that it’s no reusing connections. </div>
<br class="">
</div>
<div class="">Cheers</div>
<div class="">Jeremy</div>
<br>
<hr>
<font face="Verdana" color="Black" size="2">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@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.<br>
</font>
</body>
</html>