trac and mod_python resulting in many runaway httpd processes

1 view
Skip to first unread message

James Gallagher

unread,
Jun 11, 2008, 12:26:27 AM6/11/08
to Trac Users, James Gallagher
Hi,

I just installed trac 0.10.4 on a Centos 5 machine (an upgrade and
move from a 10.3 on a RHEL3 machine) using apache 2.2. I decided to
switch to mod_python in place of the CGI. However, with mod_python the
httpd processes seem to be running for a long, long time, so much so
that the host becomes bogged down and pretty much stops working - the
load factor will reach 15-20 before I stop apache. When I switch back
to the CGI the problem goes away. I'd really like to understand what's
up with mod_python. Any ideas?

Here's my <Location> directive for trac for use with mod_python:

<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /usr/local/scm/trac
PythonOption TracUriRoot /trac
# PythonPath "sys.path + ['/usr/share/trac']"
SetEnv PYTHON_EGG_CACHE "/var/cache/www/pythoneggs"
</Location>

I commented out PythonPath in an effort to fix this...

Other version information:

Python 2.4.3 (#1, Mar 14 2007, 18:51:08)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

mod_python-3.2.8-3.1
httpd-2.2.3-11.el5_1.centos.3
clearsilver-0.10.5

I have the trac webadmin 0.1.2 egg for python 2.4

Thanks,
James
--
James Gallagher
jgallagher at opendap.org
406.723.8663

Graham Dumpleton

unread,
Jun 12, 2008, 3:14:53 AM6/12/08
to Trac Users
The whole point of Apache/mod_python is that processes persist and a
new one isn't created for each request as is the case with CGI.

It is though generally a good idea with mod_python/Trac to force
Apache to recycle processes every so often. See the
MaxRequestsPerChild directive in Apache and read the Trac
documentation which I am sure you would probably mention using this
directive. Set it to 1000 and see how it goes.

Graham

On Jun 11, 2:26 pm, James Gallagher <jgallag...@opendap.org> wrote:
> Hi,
>
> I just installed trac 0.10.4 on a Centos 5 machine (an upgrade and  
> move from a 10.3 on a RHEL3 machine) using apache 2.2. I decided to  
> switch tomod_pythonin place of the CGI. However, withmod_pythonthe  
> httpd processes seem to be running for a long, long time, so much so  
> that the host becomes bogged down and pretty much stops working - the  
> load factor will reach 15-20 before I stop apache. When I switch back  
> to the CGI the problem goes away. I'd really like to understand what's  
> up withmod_python. Any ideas?

James Gallagher

unread,
Jun 17, 2008, 12:32:37 PM6/17/08
to trac-...@googlegroups.com, James Gallagher

On Jun 12, 2008, at 1:14 AM, Graham Dumpleton wrote:

>
> The whole point of Apache/mod_python is that processes persist and a
> new one isn't created for each request as is the case with CGI.
>
> It is though generally a good idea with mod_python/Trac to force
> Apache to recycle processes every so often. See the
> MaxRequestsPerChild directive in Apache and read the Trac
> documentation which I am sure you would probably mention using this
> directive. Set it to 1000 and see how it goes.

Thanks, I'll give that a try. I think the problem was exacerbated by
robots hitting the new machines all at once. I'll try the
MaxRequestsPerChild and see where that gets me.

James

Reply all
Reply to author
Forward
0 new messages