[mod_python] High traffic recommendations

Marc D. Murray marcdm at phronein.com
Thu Feb 16 09:44:57 EST 2006

> What did your custom Session code do ? Can you post it, so that we try
> and see what could cause the problem ?
The intention was to prevent multiple users from sharing username and
password. And to lock an account if it was used from too many

I'll post it, but before we go there, I should tell you that, I'm still
getting that dreaded "MaxClients reached" error again. Taking somewhere
of of the order of 6hrs now though.

> On Wed, 2006-02-15 at 16:06 +0100, Mike Looijmans wrote:
> > Increase MaxClients. This is the "absolute" max number of clients
> > that can be connected 
> > concurrently. You can safely put that into the 1000 range. 
I thought I couldn't go higher than 256 with this number without having
to recompile apache. Am I right? 

In the Apache config, 
 - KeepAlive On
 - MaxKeepAliveRequests 100
 - KeepAliveTimeout 300
 - StartServers 5
 - MinSpare 5
 - MaxSpare 10
 - MaxClients 120
 - MaxRequestPerChild 1000

<VirtualHost config....>
 <Directory /home/www/web4/web/>
   Options FollowSymLinks
   Order allow,deny
   allow from all
   SetHandler mod_python
   PythonHandler mod_python.publisher
   PythonDebug Off
   PythonPath "sys.path+['/home/www/web4/usr/lib']"
   AllowOverride None

# text files
<Files ~ "\.(txt|css|html?)$">
SetHandler default

<Files ~ "\.(gif|jpe?g|png|ico)$">
SetHandler default

RewriteEngine On
RewriteRule ^/(.*)\.aspx$ /$1 [P]

PythonOptimize On
ServerSignature Off

.... [error docs, logs etc]

And I'm not using my custom session. 

Let's hope that a mod_python upgrade will help. Should I also upgrade to
Python 2.4 as well? I develop with python 2.4 on my Ubuntu desktop, but
deploy to Python 2.3.5 on the Debian server. 

Do you guys think I should use the newer version of python when building


/Marc DM

More information about the Mod_python mailing list