You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Doug MacEachern <do...@covalent.net> on 2000/06/01 21:02:52 UTC

Re: Problem with mod_perl

On Fri, 26 May 2000, Eugene S. Panenko wrote:

> Hi all,
> 
> Sorry if it is an incorrect list to ask...
> 
> I have a strange problem with mod_perl. I've tested mod_perl using a very
> simple scripts (one of them is attached). The network load is emulated via LAN
> using a special proggy. The problem is: under load above 20 requests per second
> after working some time (about 15-30 sec) Apache daemon stopts accepting new
> connections and blocks forever (without -X option httpd at this moment begin
> forking until it eats all resources) . I've found that the problem exists
> only when scripts use modules (tested with CGI v 2.46, IPC::Shareable, our own
> modules).  Test scripts without modules work fine even under load of 200
> requests per second.

what are the frozen server doing if you strace them?

does it make a difference if you move 'my(%accessed)' inside your 'sub
Main'?  you should do that anyhow to avoid the 'variable won't stay
shared' problem.


RE: Problem with mod_perl

Posted by Greg Estep <ge...@thinkronize.com>.
On Fri, 26 May 2000, Eugene S. Panenko wrote:

> Hi all,
>
> Sorry if it is an incorrect list to ask...
>
> I have a strange problem with mod_perl. I've tested mod_perl using a very
> simple scripts (one of them is attached). The network load is emulated via
LAN
> using a special proggy. The problem is: under load above 20 requests per
second
> after working some time (about 15-30 sec) Apache daemon stopts accepting
new
> connections and blocks forever (without -X option httpd at this moment
begin
> forking until it eats all resources) . I've found that the problem exists
> only when scripts use modules (tested with CGI v 2.46, IPC::Shareable, our
own
> modules).  Test scripts without modules work fine even under load of 200
> requests per second.


Without knowing too much about your apache config. files, machine specs,
etc. I am guessing that your Apache MaxClients is still set at 150 (the
out-of-the-box value).

When apache receives a request that it cannot immediately handle (all of the
pre-forked process are busy) it will fork another one (up to MaxClients).
Eventually, you will run out of physical memory and begin to hit your swap
space.  When this happens, it takes longer to handle a request.  That causes
more requests to back up in the queue, so apache forks some more processes
to handle the load. These new processes increase the amount of swapping that
needs to be done, and the situation gets out of control.

How many subprocesses you can support depends upon the size of your httpd
process's text and data segments.  I have seen several mod_perl applications
increase the size of an httpd process to over 10 Mbytes.  If you set
MaxClients to a number that can be safely stored in physical memory
(adjusting for the OS and other processes running on the machine, of course)
you might eliminate your problem.

--
Greg Estep <ge...@thinkronize.com>