[mod_python] uneven speed results

Mike Looijmans nlv11281 at natlab.research.philips.com
Fri Apr 27 02:02:08 EDT 2007

Like Graham wrote, the prefork needs to load Python and your framework.

I usually configure Apache to use the worker MPM with many threads and 
few processes. The threading of Python is good on single-CPU systems, 
and for multi-CPU systems, just set the min number of processes to equal 
the number of CPUs to compensate. This reduces the memory consumption of 
Apache with mod_python considerably, aiding performance.

If you want a constant response time, you may want to consider using CGI 
for rarely-used sites. The response will be slower, since starting the 
interpreter takes about 20 ms. Since you report 150ms as shortest time, 
I do not think this solution viable for your application.

Mike Looijmans
Philips Natlab / Topic Automation

ml wrote:
> For a large count of requests it gives some constant reply time. But
> rarely visited sites have a long "warm up" (sometimes over 2 seconds)
> and that is too much. I'm just curious what makes the difference between
> e.g. 150ms and 1500ms respond times.
> D
> Graham Dumpleton napsal(a):
>>Using 'ab' with such small numbers of requests always yields
>>unreliable results. What do you get if you use 5000-10000 requests?
>>Also note that using -k isn't a realistic measure of real world
>>performance as no single client is going to trigger large numbers of
>>requests over the same connection, so don't use -k when using the
>>large number of requests I suggest.
>>On 26/04/07, ml <ml at dasir.net> wrote:
>>>I was wondering why mod_python (3.2.8) has so uneven speed results, e.g.:
>>># ab -k -c1 -n15 some_python_site
>>>Percentage of the requests served within a certain time (ms)
>>>  50%    158
>>>  66%    161
>>>  75%    165
>>>  80%    166
>>>  90%   1173
>>>  95%   1209
>>>  98%   1209
>>>  99%   1209
>>> 100%   1209 (longest request)
>>>When I compare it to a PHP it has constant response time on each request.
>>>I know that the startup can take some more time but sometimes it takes a
>>>longer time when I do refreshing the page in a browser so the startup
>>>can't affect the response (I think :-).
>>>What all does affect the mod_python runtime?
>>>Mod_python mailing list
>>>Mod_python at modpython.org
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list