You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ra...@itdz-berlin.de on 2006/08/17 14:17:40 UTC

[users@httpd] Appropiate Configuration of No. of Startup and Standby Servers

Hello Apache Users/Admins,

I think I have a performance issue in that the master httpd
cannot fork enough children
to satisfy all concurrent connect requests,
because I get these in error_log:

# grep server\ seems\ busy $SERVERROOT/logs/error_log|tail
[Wed Aug 09 21:21:27 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 18 idle, and 48 total children
[Wed Aug 09 21:43:25 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 19 idle, and 57 total children
[Thu Aug 10 12:43:10 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 36 idle, and 68 total children
[Sun Aug 13 17:55:04 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 38 idle, and 73 total children
[Mon Aug 14 08:29:56 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 38 idle, and 84 total children
[Mon Aug 14 10:20:25 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 39 idle, and 92 total children
[Mon Aug 14 11:40:27 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 39 idle, and 96 total children
[Wed Aug 16 14:05:01 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 37 idle, and 88 total children
[Wed Aug 16 17:35:38 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 36 idle, and 75 total children
[Thu Aug 17 09:13:36 2006] [info] server seems busy, (you may
need to increase StartServers, or Min/MaxSpareServers), spawning
8 children, there are 36 idle, and 71 total children


I already increased MaxClients, StartServers, Min|MaxSpareServers
and thought they were high enough.

# sed -n '/^<IfModule prefork/,/^<\/IfModule/p'
$SERVERROOT/conf/httpd.conf
<IfModule prefork.c>
StartServers      40 
MinSpareServers   40
MaxSpareServers   80
ServerLimit      512
MaxClients       512
MaxRequestsPerChild  4000
</IfModule>


The machine has 4 GB of physical memory, and a 2 GB swap device

# free -mt
             total       used       free     shared    buffers
cached
Mem:          4047       3906        141          0        488
2435
-/+ buffers/cache:        982       3065
Swap:         1960          0       1960
Total:        6008       3906       2102
 

# swapon -s
Filename                                Type            Size
Used    Priority
/dev/md2                                partition       2007992
176     -1



This is the Webserver version, and module support

# /usr/sbin/httpd -v
Server version: Apache/2.0.52
Server built:   Oct 15 2004 11:39:29
 
# /usr/sbin/httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c


This is the OS and kernel version

# cat /etc/redhat-release 
Fedora Core release 3 (Heidelberg)
 
# uname -srvmio
Linux 2.6.9-1.667smp #1 SMP Tue Nov 2 14:59:52 EST 2004 i686 i386
GNU/Linux



I have read the explanations to the above mentioned httpd.conf
directives
from http://httpd.apache.org/docs/2.0/mod/prefork.html several
times.
But to be honest, the more I read them the more contradicting
they seem to me.
I ask, why can't the master httpd spawn enough children fast
enough
when it always has according to the error_log entries well over
30 idle servers,
and the MinSpareServer was configured to such a high value as 40?
Why are the error_log entries suggesting I even need to raise
them?
I would assume that in such a case it had to spawn even more
children to arrive at
the lower MinSpareServers, being even more occupied with the task
to service pending
connect requests.
Any suggestion as how to tune the prefork params would be highly
appreciated.


Regards

Ralph


P.S.


Although this may undermine list policies,
I have attached three rrdtool charts of weekly 
scoreboard stats, apache procs, and memory usage.
You may notice the sudden leap of "waiting for connect" children 
in the scoreboard chart from last Thursday onwards.
This was when I already doubled the parameter values.
In the charts I never can see a shortage but only lingering idle
children.

Re: [users@httpd] Appropiate Configuration of No. of Startup and Standby Servers

Posted by Joshua Slive <jo...@slive.ca>.
On 8/17/06, Ralph.Grothe@itdz-berlin.de <Ra...@itdz-berlin.de> wrote:

> [Thu Aug 17 09:13:36 2006] [info] server seems busy, (you may
> need to increase StartServers, or Min/MaxSpareServers), spawning
> 8 children, there are 36 idle, and 71 total children
>
>
> I already increased MaxClients, StartServers, Min|MaxSpareServers
> and thought they were high enough.
>
> # sed -n '/^<IfModule prefork/,/^<\/IfModule/p'
> $SERVERROOT/conf/httpd.conf
> <IfModule prefork.c>
> StartServers      40
> MinSpareServers   40
> MaxSpareServers   80
> ServerLimit      512
> MaxClients       512
> MaxRequestsPerChild  4000
> </IfModule>

> I have read the explanations to the above mentioned httpd.conf
> directives
> from http://httpd.apache.org/docs/2.0/mod/prefork.html several
> times.
> But to be honest, the more I read them the more contradicting
> they seem to me.
> I ask, why can't the master httpd spawn enough children fast
> enough
> when it always has according to the error_log entries well over
> 30 idle servers,
> and the MinSpareServer was configured to such a high value as 40?
> Why are the error_log entries suggesting I even need to raise
> them?
> I would assume that in such a case it had to spawn even more
> children to arrive at
> the lower MinSpareServers, being even more occupied with the task
> to service pending
> connect requests.
> Any suggestion as how to tune the prefork params would be highly
> appreciated.

Your central problem is that you have MinSpareServers set way too
high.  You are thus forcing apache to continually maintain a huge pool
of idle servers.  In your case I would recommend a MinSpareServers of
10 or less.

(Perhaps the error message is a little misleading in this case, since
you actually need to lower a value rather than raise it.  It is not
reporting a problem answering requests, but rather a problem
maintaining the arbitrarily high number of idle children that you have
targetted.)

Also note, however, that an occasional "server seems busy" message in
your logs is nothing to worry about.  You should only be concerned if
you see these very frequently, or if you notice poor performance.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org