[mod_python] High traffic recommendations

Nicolas Lehuen nicolas at lehuen.com
Wed Feb 15 13:27:46 EST 2006


Marc,

What did your custom Session code do ? Can you post it, so that we try
and see what could cause the problem ?

Regards,
Nicolas

2006/2/15, Marc D. Murray <marcdm at phronein.com>:
> Thank you all for Your tips and responses.
>
> > Is this server live on the internet or in a stand alone lab?
> > Is it possible that there maybe a new virus attaching your machine
> > when it connected to the net
> It's live on the 'net. But I hope it's not a virus on Debian. Cuz I have
> no anti-virus on any of my Debian Boxes :)
>
>
> > And what do you get in error logs? Does it crash while processing your
> > code or on directly in Apache?
> >
> > Where did you see DBNoMemory and who reported it? What drivers do you
> > use and how do you handle db connections?
> The  DB Errors were from the bsddb.DBEnv runninng out of connections.
> Not sure why this would happen as it was supposedly designed for many
> connections.
> But I'm currently using a global bsddb.DBEnv connection to a folder that
> holds many *.bdb files. These are opened stuffed into a queue. The are
> closed if older than 2 hrs.
> I don't get these errors  anymore.
>
>
> > How does Apache behave WRT memory ? There are known memory leaks in
> > mod_python version prior to 3.2.7, so
> Each apache process hovers between 3.2 and 4.7 % (readin from top). I
> ran some tests on my local server using /usr/sbin/ab, but it never went
> down. Not even when requests set to 50000.
>
> > I would advise you to upgrade to 3.2.7 if you can
> Now this is something I've been thinking of. I'll look into it later
> tonite.
>
>
> > >       MaxRequestsPerChild  500
> >
> > Make that 10000 or so. This low a number is only required if your
> > system is leaking lots of resources (which mod_python does not do).
> Now I'm confused. Does it leak or not? How do I test for that?
>
>
> I've changed the config in the following way :
>   - AddHandler python-program py
>   + SetHandler mod_python
>   - PythonOption SessionDbm=blahblah
>   + lines to SetHandler = Default for *.(jpg|gif|png|html|txt)
>
>   -MultiViews
>   KeepAlive On
>   KeepAliveTimout 300
>   MaxKeepAlive 100
>
>   MaxRequestsPerChild 1000
>
> This seems to solve the problem with errors I saw in the logs stating
> [No Available Variant]
>
> Occationally, I see a 404 error in the logs pointing to the wrong
> web-root. Actually it points to the only site on the server running
> under mod_jk. Is there some sort of contention between the two?
>
> Actually, while writing this email I was checking the server and it
> seems that I've solved the problem.
>
> I had a custom session object, that inherited from DBMSession. This was
> done to implement some other actions at cleanup time. I commented out