<br><div class="gmail_quote">2011/2/24 Oliver Tonnhofer <span dir="ltr">&lt;<a href="mailto:tonnhofer@omniscale.de">tonnhofer@omniscale.de</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
On 23.02.2011, at 17:23, Andreas Trawoeger wrote:<br>
&gt; If there isn&#39;t any explicit need to use Apache I can highly recommend to take a look at Gunicorn [0].<br>
&gt;<br>
&gt; Gunicorn has direct WSGI and Paster support and makes running a MapProxy webserver as simple as &quot;gunicorn_paster /home/scheibe/mapproxy/prod/prod.ini&quot;<br>
&gt;<br>
&gt; If you want to combine Gunicorn with Apache you can use e.g. mod_proxy to forward request from Apache to Gunicorn/Mapproxy or use a webserver like Nginx [1] that supports high performance proxying from the beginning.<br>

<br>
</div>Warning, advanced technical discussion below :)<br>
<br>
Be careful, the default worker for gunicorn are synchronous. That is, each requests blocks the whole worker process and if you have a missing tile, the process will have to wait for the source server. It&#39;s not an issue if have a full cache _and_ are using a buffering proxy in front of it (like Nginx or varnish). An Apache mod_proxy server does not help here, because Apache keeps the worker process active until the client retrieved the last byte, which can take some time.<br>

<br>
We are using gunicorn with eventlet as a worker and that does not suffer from these issues.<br></blockquote><div><br><br>That hasn&#39;t been much of an issue to me. If a tile is missing in the MapProxy cache chances are extremely high that the other requested tiles have to be fetched from source server too and prefetching tiles via cache/meta_size normally works very well. <br>
<br>So the first tile request forwarded to the source server will block the whole request for a while, but after the first tile is done the other tile requests work pretty fast, because the first one has already seeded the cache.<br>
<br>Where I did actually run into trouble was the street view mode in Google Earth. The street view mode sends a lot of requests at very high zoom levels for positions that appear to be almost random and uses a hard coded 15 second network timeout for tile requests.<br>
 <br>After some testing I came to the conclusion that without heavy preseeding I could never render all the tiles needed for Google Earth  street view mode within 15 seconds and declared Google Earth street view mode as currently unsupported.<br>
<br><br>cu andreas <br></div></div>