On 12/13/06, Kevin Jones <kevwjones@xxxxxxxxx> wrote:
I'm running an Apache server on a FreeBSD server with 494 MB of RAM and an Intel Celeron 2.4 GHz CPU. A recent surge of traffic to my PHP site has been causing the server to come to its knees. The first symptom is that the server won't return my page when I access it through the browser. The connection times out. In researching, I found out that my available RAM had become cripplingly low (about 1 meg) because Apache had spawned over 100 different processes of itself. So, I figured the way to fix this was to limit how many processes Apache would start up max, so I edited the httpd.conf and set MaxClients to 40 (I'm using the prefork MPM) and KeepAliveTimeout to 15. That's fine, but now it runs out of available processes to handle requests very soon. I run "top" to see what's happening, and I see that most of the apache processes are in the "lockf" state. And a few are in "sbwait". I run "ps", and see that most of the apache processes are idle or sleeping. What do lockf and sbwait mean? Are the processes just idling? How do I get the Apache processes to die?
The best way to figure out what is really going on is to use the server-status handler provided by mod_status. You'll probably find that most of your processes are waiting on keep-alive connections. For a server with inadequate resources, a KeepAliveTimeout of 15 is way too high. You want to consider something under 5 seconds, and perhaps even turning off keepalive entirely depending on your load characteristics. 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx