Apache [error] server reached MaxClients setting, consider raising the MaxClients setting

Recently, a company customer reported a problem with an error message in the Apache log /var/log/ HTTPD /error_log file after running for a while

[Fri Jul 29 15:45:37 2016] [error] server reached MaxClients setting, consider raising the MaxClients setting

I checked that this was due to the number of concurrent links. Later, I checked the Apache documentation and found that I could modify the Apache configuration file
The/etc/HTTPD/conf/HTTPD. Conf the MaxClients parameter to adjust.
In adjusting the first thing to check before running apache is a kind of mode is prefork or worker, use “/ usr/sbin/HTTPD -l” command to check, after checking out what kind of pattern, you can find the/etc/HTTPD/conf/HTTPD. Corresponding to the configuration of the part to modify the conf.

# httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

Change the parameters and put them in

<IfModule prefork.c>  
StartServers       8  
MinSpareServers    5  
MaxSpareServers   20  
ServerLimit      256  
MaxClients       256  
MaxRequestsPerChild  4000  
</IfModule> 

Modified to

<IfModule prefork.c>  
StartServers     8  
MinSpareServers  5  
MaxSpareServers  20  
ServerLimit     1024  
MaxClients      1024  
MaxRequestsPerChild  50  
</IfModule>

Then restart Apache “Service HTTPD Restart”.
The meaning of parameters is explained in detail in the Apache configuration, as follows:

# prefork MPM  
# StartServers: number of server processes to start  
# MinSpareServers: minimum number of server processes which are kept spare  
# MaxSpareServers: maximum number of server processes which are kept spare  
# ServerLimit: maximum value for MaxClients for the lifetime of the server  
# MaxClients: maximum number of server processes allowed to start  
# MaxRequestsPerChild: maximum number of requests a server process serves  
# worker MPM  
# StartServers: initial number of server processes to start  
# MaxClients: maximum number of simultaneous client connections  
# MinSpareThreads: minimum number of worker threads which are kept spare  
# MaxSpareThreads: maximum number of worker threads which are kept spare  
# ThreadsPerChild: constant number of worker threads in each server process  
# MaxRequestsPerChild: maximum number of requests a server process serves  

Read More: