[Tilecache] tilecache_ mod_python and keep-alive
Guillaume Sueur
guillaume.sueur at neogeo-online.net
Wed May 21 13:03:00 EDT 2008
Hi Chris,
Thanks for these informations. To go further, here is the URL I use:
http://192.168.0.198/tilecache/tilecache.py?LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=90,45,135,90&WIDTH=256&HEIGHT=256
I get the same text/xml response with either quotes, double-quotes or
none. Actually, I think ab is not provided image/png as an Accept format
and I'm trying to deal with it. It doesn't seem to be an Apache problem
as Lighttpd returns the same content (but is able to handle a proper
alive connection by the way)...
About the tilecache.py, I just followed the installation instructions
(http://www.tilecache.org/readme.html#running-under-mod-python) as you
suggest : "Visit one of the URLs described above, replacing
tilecache.cgi with tilecache.py"
As the handler is designed for handling .py script (AddHandler
python-program .py), it was logical to rename tilecache.cgi to
tilecache.py no ?
Regards,
Guillaume
Christopher Schmidt a écrit :
> On Wed, May 21, 2008 at 06:40:26PM +0200, Guillaume Sueur wrote:
>> I'm making tests on tilecache performances under various configurations.
>> When using mod_python, it appeared that even if requested, the
>> keep-alive http mode was not active.
>> ab (Apache bench) makes it obvious :
>> ab -v 3 -k -n 1 -c1 myURL
>
> myURL here doesn't actually specify enough information to guess what you
> are getting here. I expect that you're putting a URL with an "&" in it,
> and as a result, bash or some similar tool is backgrounding the process,
> rather than sending the remaining URL parts to the server. The end
> result is that the URL that the server gets looks like
> "http://localhost/?layers=foo" which is not enough for TileCache to
> guess that it is a WMS URL, so it treats it like a TMS metadata request
> (the default for anything that doesn't get matched by any service). To
> resolve this, the right solution is probably to just put it in single
> quotes: 'http://url.com/?foo=bar&bar=baz'
>
>> where it should be Keep-Alive requests : 1
>>
>> After few investigations, it came to me that mod_python needed the
>> content_length to be set
>> (http://www.modpython.org/pipermail/mod_python/2004-August/016019.html)
>> so I've added
>> apacheReq.set_content_length = len(image) to Service.modPythonHandler
>
> This seems a reasonable patch to submit against trunk, but please apply
> it equally across the three handlers.
>
>> on the top of that, the response in ab is a text/xml stuff :
>> <?xml version="1.0" encoding="UTF-8" ?>
>
> This problem is described above.
>
>> so, I guess it's quite confusing, so I'll sum it up with few questions :
>> - does tilecache.py must be changed with modPythonHandler instead of
>> cgiHandler for mod_python to be used ?
>
> Your apache server needs to be configured for mod_python, following the
> instructions in the documentation. There is no tilecache.py included
> with TileCache, so I don't know where you got that file, but none should
> exist. If removing the file you hae called tilecache.py causes things to
> work, then you have not correctly configured mod_python.
>
>> - can you understand why I get different Response Headers and Response
>> when I use ab tool ?
>
> See above.
>
> Regards,
--
Guillaume SUEUR
Expert SIG et OpenSource
NEOGEO
46 RUE MATABIAU
31000 TOULOUSE
06 74 91 95 20
Site web : http://www.neogeo-online.net
More information about the Tilecache
mailing list