Apache hanging with MaxClients is reached
Posted
by Ash White
on Server Fault
See other posts from Server Fault
or by Ash White
Published on 2009-09-02T18:40:06Z
Indexed on
2010/04/18
21:03 UTC
Read the original article
Hit count: 565
My Apache 2.2 (preform MPM) is hanging when MaxClients is reached, rather than queueing up requests and serving them when child processes become free. When this happens, the web server is totally unresponsive until it is manually restarted.
The server stack is Ubuntu 8, MySQL 5, PHP 5. Hardware is Dual Xeons (2.8) with 2GB of RAM. It serves 30,000 - 50,000 pageviews per day. Static images, CSS, and JS are offloaded to a separate server and PHP is cached using eAccelerator. The HTML output of many pages is cached to the filesystem.
Relevant Apache directives:
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 2
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 2000
© Server Fault or respective owner