Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to edit my httpd.conf to accept max of 1,000 clients connections. this is what I have now:

StartServers       8
MinSpareServers    5
MaxSpareServers   20
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  4000



StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

How should I edit it?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Assuming you have enough RAM to serve the requests, and you are using the prefork multi-processing module, you can use the 2 directives MaxClients and ServerLimit to set the total number of simultaneous requests that will be served;

To check for prefork run apachectl -V | grep MPM and look for the following output;

#  apachectl -V | grep MPM
Server MPM:     Prefork
 -D APACHE_MPM_DIR="server/mpm/prefork"

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.

But the ServerLimit also puts a maximum limit on the number of processes that apache will spawn to serve requests.

For the prefork MPM, the ServerLimit directive sets the maximum configured value for MaxClients for the lifetime of the Apache process..

hence I would go for something like;

ServerLimit 1000   
MaxClients 1000     

Alternatively for For the worker MPM, this directive in combination with ThreadLimit sets the maximum configured value for MaxClients for the lifetime of the Apache process. Any attempts to change this directive during a restart will be ignored workers ThreadLimit docs here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.