Apache Tuning StartServers & Min/MaxSpareServers

Each day I am seeing more and more of these in my error_logs:


[Mon May 16 13:12:28 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 82 idle, and 91 total children

[Mon May 16 13:12:29 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 88 idle, and 97 total children

[Mon May 16 13:12:30 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 32 children, there are 99 idle, and 109 total children

[Mon May 16 13:12:38 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 92 idle, and 101 total children

[Mon May 16 13:12:39 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 99 idle, and 105 total children

[Mon May 16 13:58:56 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 101 idle, and 108 total children

[Mon May 16 13:58:57 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 103 idle, and 116 total children

[Mon May 16 13:59:05 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 99 idle, and 105 total children

[Mon May 16 13:59:20 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 80 idle, and 91 total children

[Mon May 16 13:59:21 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 93 idle, and 96 total children

[Mon May 16 14:41:10 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 96 idle, and 104 total children

[Mon May 16 14:41:11 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 16 children, there are 98 idle, and 109 total children

[Mon May 16 14:41:34 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 104 idle, and 110 total children

[Mon May 16 15:20:10 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 101 idle, and 110 total children

[Mon May 16 15:20:17 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 95 idle, and 106 total children

[Mon May 16 15:56:14 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 104 idle, and 110 total children

[Mon May 16 15:56:36 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 102 idle, and 112 total children

[Mon May 16 15:56:57 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 103 idle, and 109 total children

[Mon May 16 16:29:43 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 103 idle, and 112 total children

[Mon May 16 16:32:17 2011] [info] server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers), spawning 8 children, there are 104 idle, and 113 total children

This box is a dual, quad core, 64-bit, CentOs 5.2 box with 13GB ram running apache 2.2+ and mysql 5.2+. Current apache settings are:


Server Limit 600
Max Clients 320
Start Servers 250
Spare Servers Min 105
Spare Servers Max 145
Max Requests Per Server 100
Timeout 60
KeepAlive Off

Am I missing something on the config that will help get rid of the bottleneck? I have been bumping up the StartServers and the Min/Max SpareServers over the last few days in increments of 10 to no avail.

whats the traffic on the site like? how many consecutive requests?

Spare Servers Min is maybe a bit high? you are saying you want to keep 105 servers ‘ready’ tehre which is why it’ll be constantly trying to start more…

This is a busy server on an uncapped Gig-E switch, but I have since lowered StartServers and SpareServers min/max values to allow apache some headroom. I will report back. Top is now reporting:


top - 20:09:37 up 8 days,  1:23,  1 user,  load average: 0.70, 0.78, 0.72
Tasks: 340 total,   1 running, 339 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.9%us, 10.1%sy,  0.0%ni, 78.3%id,  0.5%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:  13336576k total,  9416828k used,  3919748k free,  1313668k buffers
Swap:  2031608k total,      136k used,  2031472k free,  5229596k cached


you can keep start servers high, thats fine - thats what to start up when you start apache, however, you don’t want to keep spare servers min too high, that’ll use resources that are sat idle. Personally, I don’t use the min / max, and just let Apache work it out itself :slight_smile: