You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Anthony E." <ap...@yahoo.com> on 2002/08/07 01:24:55 UTC

mod perl load average too high

I'm using apache 1.3.26 and mod_perl 1.27

My apache processes seem to be taking up more and more
system resources as time goes on.

Can someone help me determine why my server load is
going up?

When i first start apache, my "load average" is about
.02, but after a couple of hours, it goes up to 4 or
5, and after a couple of days, has been as high as
155.

I have the following directives configured in
httpd.conf:

MaxKeepAliveRequests 100
MinSpareServers 5 
MaxSpareServers 20
StartServers 10
MaxClients 200
MaxRequestsPerChild 5000

Here is a snip of 'top' command:
  6:28pm  up 46 days, 23:03,  2 users,  load average:
2.24, 2.20, 1.98
80 processes: 74 sleeping, 6 running, 0 zombie, 0
stopped
CPU0 states: 99.3% user,  0.2% system,  0.0% nice, 
0.0% idle
CPU1 states: 100.0% user,  0.0% system,  0.0% nice, 
0.0% idle
Mem:  1029896K av,  711884K used,  318012K free,      
0K shrd,   76464K buff
Swap: 2048244K av,  152444K used, 1895800K free       
          335796K cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM
  TIME COMMAND
25893 nobody    16   0 10188 9.9M  3104 R    95.5  0.9
 21:55 httpd
25899 nobody    16   0  9448 9448  3104 R    95.3  0.9
 63:27 httpd
25883 nobody     9   0 10468  10M  3096 S     2.5  1.0
  0:16 httpd
25895 nobody     9   0 10116 9.9M  3104 S     2.1  0.9
  0:15 httpd
25894 nobody     9   0 10240  10M  3104 S     1.9  0.9
  0:16 httpd
25898 nobody     9   0 10180 9.9M  3100 S     1.7  0.9
  0:13 httpd

Also, I notice in my error_log i get this entry quite
frequently:
26210 Apache::DBI new connect to
'news:1.2.3.4.5userpassAutoCommit=1PrintError=1'

What can i do to keep the server load low?


=====
Anthony Ettinger
apwebdesign@yahoo.com
http://apwebdesign.com
home: 415.504.8048
mobile: 415.385.0146

__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

Re: mod perl load average too high

Posted by Ed Grimm <ed...@tgape.org>.
That looks like there's something that occasionally goes off and starts
spinning, given the low memory usage and the fact that some processes
using little cpu are also not swapped out.

I suspect that one of your pages has a potential infinite loop that's
being triggered.  Try and catch at what point the load suddenly starts
rising, and check what pages were accessed around that time.  They're
where you should start looking.

Note that you should probably focus on the access and error log lines
that correspond with processes that are using excessive amounts of cpu.

Ed

On Tue, 6 Aug 2002, Anthony E. wrote:

> I'm using apache 1.3.26 and mod_perl 1.27
> 
> My apache processes seem to be taking up more and more
> system resources as time goes on.
> 
> Can someone help me determine why my server load is
> going up?
> 
> When i first start apache, my "load average" is about
> .02, but after a couple of hours, it goes up to 4 or
> 5, and after a couple of days, has been as high as
> 155.
> 
> I have the following directives configured in
> httpd.conf:
> 
> MaxKeepAliveRequests 100
> MinSpareServers 5 
> MaxSpareServers 20
> StartServers 10
> MaxClients 200
> MaxRequestsPerChild 5000
> 
> Here is a snip of 'top' command:
>   6:28pm  up 46 days, 23:03,  2 users,  load average:
> 2.24, 2.20, 1.98
> 80 processes: 74 sleeping, 6 running, 0 zombie, 0
> stopped
> CPU0 states: 99.3% user,  0.2% system,  0.0% nice, 
> 0.0% idle
> CPU1 states: 100.0% user,  0.0% system,  0.0% nice, 
> 0.0% idle
> Mem:  1029896K av,  711884K used,  318012K free,      
> 0K shrd,   76464K buff
> Swap: 2048244K av,  152444K used, 1895800K free       
>           335796K cached
> 
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM
>   TIME COMMAND
> 25893 nobody    16   0 10188 9.9M  3104 R    95.5  0.9
>  21:55 httpd
> 25899 nobody    16   0  9448 9448  3104 R    95.3  0.9
>  63:27 httpd
> 25883 nobody     9   0 10468  10M  3096 S     2.5  1.0
>   0:16 httpd
> 25895 nobody     9   0 10116 9.9M  3104 S     2.1  0.9
>   0:15 httpd
> 25894 nobody     9   0 10240  10M  3104 S     1.9  0.9
>   0:16 httpd
> 25898 nobody     9   0 10180 9.9M  3100 S     1.7  0.9
>   0:13 httpd
> 
> Also, I notice in my error_log i get this entry quite
> frequently:
> 26210 Apache::DBI new connect to
> 'news:1.2.3.4.5userpassAutoCommit=1PrintError=1'
> 
> What can i do to keep the server load low?
> 
> 
> =====
> Anthony Ettinger
> apwebdesign@yahoo.com
> http://apwebdesign.com
> home: 415.504.8048
> mobile: 415.385.0146
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
> 


Re: mod perl load average too high

Posted by si...@siberian.org.
Here are the standard questions :

1) Are you running a reverse proxy in front? This helps 
keep things low.
2) Are you running Apache::Resource to limit each childs 
usage? That has saved me.
3) Are you running Apache::DBI? That really helps a ton.
4) How much ram are you running? Once you hit swap you are 
D-E-A-D. Make sure you dont hit swap by either adding ram 
or reducing the memory footprint of your code. As you 
spiral into the Swap Death Spiral your load goes up 
rapidly. I've seen those 150 loads also, never fun.

John-

On Tue, 6 Aug 2002 16:24:55 -0700 (PDT)
  "Anthony E." <ap...@yahoo.com> wrote:
>I'm using apache 1.3.26 and mod_perl 1.27
>
>My apache processes seem to be taking up more and more
>system resources as time goes on.
>
>Can someone help me determine why my server load is
>going up?
>
>When i first start apache, my "load average" is about
>.02, but after a couple of hours, it goes up to 4 or
>5, and after a couple of days, has been as high as
>155.
>
>I have the following directives configured in
>httpd.conf:
>
>MaxKeepAliveRequests 100
>MinSpareServers 5 
>MaxSpareServers 20
>StartServers 10
>MaxClients 200
>MaxRequestsPerChild 5000
>
>Here is a snip of 'top' command:
>   6:28pm  up 46 days, 23:03,  2 users,  load average:
>2.24, 2.20, 1.98
>80 processes: 74 sleeping, 6 running, 0 zombie, 0
>stopped
>CPU0 states: 99.3% user,  0.2% system,  0.0% nice, 
>0.0% idle
>CPU1 states: 100.0% user,  0.0% system,  0.0% nice, 
>0.0% idle
>Mem:  1029896K av,  711884K used,  318012K free,      
>0K shrd,   76464K buff
>Swap: 2048244K av,  152444K used, 1895800K free       
>           335796K cached
>
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM
>   TIME COMMAND
>25893 nobody    16   0 10188 9.9M  3104 R    95.5  0.9
>  21:55 httpd
>25899 nobody    16   0  9448 9448  3104 R    95.3  0.9
>  63:27 httpd
>25883 nobody     9   0 10468  10M  3096 S     2.5  1.0
>   0:16 httpd
>25895 nobody     9   0 10116 9.9M  3104 S     2.1  0.9
>   0:15 httpd
>25894 nobody     9   0 10240  10M  3104 S     1.9  0.9
>   0:16 httpd
>25898 nobody     9   0 10180 9.9M  3100 S     1.7  0.9
>   0:13 httpd
>
>Also, I notice in my error_log i get this entry quite
>frequently:
>26210 Apache::DBI new connect to
>'news:1.2.3.4.5userpassAutoCommit=1PrintError=1'
>
>What can i do to keep the server load low?
>
>
>=====
>Anthony Ettinger
>apwebdesign@yahoo.com
>http://apwebdesign.com
>home: 415.504.8048
>mobile: 415.385.0146
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Health - Feel better, live better
>http://health.yahoo.com