Map Application Performance Tuning - Part 3

01/19/2010

The performance of the Tilecache server can be improved by using mod_python instead of CGI. This blog post shows the results of a benchmark test made on a windows machine.

1. Installing mod_python on OpenSuse is easy with Zypper:
# sudo zypper install apache2-mod_python
did the job.

2. I added a configuration file to /etc/apache2/conf.d named mod_python.conf with the following entries:

LoadModule python_module /usr/lib64/apache2/mod_python.so
<Directory /webservice/cgi-bin/tilecache/><br/> AddHandler python-program .py<br/> PythonHandler TileCache.Service<br/> PythonOption TileCacheConfig /webservice/cgi-bin/tilecache/tilecache.cfg<br/> </Directory>
3. I restarted Apache2. The error_log in /var/log/apache2/ indicates that the module was also loaded successfully:
Apache/2.2.10 (Linux/SUSE) mod_ssl/2.2.10 OpenSSL/0.9.8h mod_fastcgi/2.4.6 mod_python/3.3.1 Python/2.6 Phusion_Passenger/2.2.5 configured -- resuming normal operations

4. I changed the code of my application and replaced tilecache.cgi by tilecache.py:
var layer = new OpenLayers.Layer.WMS("name","http://localhost/cgi-bin/tilecache/tilecache.py", { maxExtent:new OpenLayers.Bounds(-198,-115.542749339137,198,109.146905833277), maxResolution:156543.0339, layers:"worldtest", transparent:true });

5. Did the first test and it really seems to be noticeably faster. YEAH!

No comments yet.