[MapProxy] Re: MapProxy and Gunicorn

Andreas Trawoeger atrawog at datenscheibe.org
Thu Feb 24 07:28:04 EST 2011


2011/2/24 Oliver Tonnhofer <tonnhofer at omniscale.de>

>
> On 23.02.2011, at 17:23, Andreas Trawoeger wrote:
> > If there isn't any explicit need to use Apache I can highly recommend to
> take a look at Gunicorn [0].
> >
> > Gunicorn has direct WSGI and Paster support and makes running a MapProxy
> webserver as simple as "gunicorn_paster
> /home/scheibe/mapproxy/prod/prod.ini"
> >
> > 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.
>
> Warning, advanced technical discussion below :)
>
> 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'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.
>
> We are using gunicorn with eventlet as a worker and that does not suffer
> from these issues.
>


That hasn'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.

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.

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.

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.


cu andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapproxy/attachments/20110224/354363ca/attachment.html


More information about the MapProxy mailing list