[Tilecache] tilecache_ mod_python and keep-alive

Guillaume Sueur guillaume.sueur at neogeo-online.net
Wed May 21 12:40:26 EDT 2008


Hi,

It's my first post on this list and I 'lltry not to be too confused...

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
returns :
Concurrency Level:      1
Time taken for tests:   0.114140 seconds
Complete requests:      1
Failed requests:        0
Write errors:           0
Keep-Alive requests:    0

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

but to make the difference visible I had to change my tilecache.py too, 
changing the cgiHandler to modPythonHandler.
Nevertheless, if the response headers have been changed to
Keep-Alive	timeout=2, max=97
Connection	Keep-Alive

but even with this, ab still returns a Keep-Alive requests:    0
on the top of that, the response in ab is a text/xml stuff :
<?xml version="1.0" encoding="UTF-8" ?>
             <Services>
                 <TileMapService version="1.0.0" 
href="http://192.168.0.198/1.0.0/" />
             </Services>

while the same request in firefox returns an image.


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 ?
- can you understand why I get different Response Headers and Response 
when I use ab tool ?

Many thanks for having read all that stuff,


-- 
Guillaume SUEUR





More information about the Tilecache mailing list