While my recent server transfer has been smooth sailing, I did encounter one error that bugged the hell out of me.
At certain points of the day, I’d be receiving a notice that my VPS had it’s httpd process fail and restart automatically. A copy of the email is posted below:
httpd failed @ Sun Apr 10 07:07:09 2011.. A restart was attempted automagically.
Service Check Method: [tcp connect]Failure Reason: Unable to connect to port 80
After a quick bout of google-fu I found our that the server is exceeding the allowed number of connections 🙁 Not good considering that the new server is quite powerful enough to handle more than it’s current peak traffic. Reading further into this, I had to execute this line:
grep MaxClients /usr/local/apache/logs/error_log
which then netted me this response:
WARNING: MaxClients of 512 exceeds ServerLimit value of 256 servers, lowering MaxClients to 256. To increase, please see the ServerLimit [Sat Apr 09 12:47:10 2011] [error] server reached MaxClients setting, consider raising the MaxClients setting
Soooo the problem is how apache is setup. The fix? Simply log in to cPanel and set the setting for MaxClients to something higher (in my case I doubled the number from 256 to 512) as well as he ServerLimit (to the same number). Of course if you want to do this manually, simply edit the MaxClients settings on apache’s httpd.conf file and restart the server.