Monday, December 9, 2013

Apache - MaxClients

www.unixbabuforum.inWe have a Apache web server (LAMP) with cpanel tool installed. What should be the MaxClients and ServerLimit? for 4 GB RAM. Server load is 2000 guest and 200 login users at peak time and apache hangs everday because of load. We are running mysql database in different server with 4GB RAM. 

Current Apache setting 
<IfModule prefork.c> 
StartServers 16 
MinSpareServers 8 
MaxSpareServers 64 
ServerLimit 1000 
MaxClients 600 
MaxRequestsPerChild 5000 
</IfModule> 

www.unixbabuforum.inTake a look at: 
http://httpd.apache.org/docs/2.0/misc/perf-tuning.html 

The MaxClients directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced. 
A simple calculation for MaxClients on a system would be: 

(Total Memory - Operating System Memory - MySQL memory) / Size Per Apache process. 

On some systems, there is another parameter that sets an upper limit if MySQL. So for example, if ServerLimit is set by default to 1000, and you want to increase MaxClients to 3000, you will not be able to do so, until you set ServerLimit to 1000 as well.

0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM