After visiting the company website to reach a certain number, suddenly can't access, view Apache error log See "server reached maxclients Setting,consider raising the Max clients setting", first with /usr/local/apache//bin/httpd-l or/USR/SBIN/HTTPD-L confirms that Apache is working in Prefork worker event mode, which is typically prefork mode by default.
Modify/usr/local/apache/conf/extra/http-mpm.conf
<ifmodule mpm_prefork_module>
Serverlimit 256
Startservers 5
Minspareservers 5
Maxspareservers 10
MaxClients 256
Maxrequestsperchild 0
</IfModule>
The default maxclient maximum is 256 threads, if you want to set a larger value, add serverlimit this parameter
Startservers
Specifies the number of child processes that are established when the server starts, and Prefork defaults to 5.
Minspareservers
Specifies the minimum number of idle child processes, which defaults to 5. If the number of currently idle child processes is less than minspareservers, then Apache will produce a new subprocess at a maximum speed of one second. Do not set this parameter too large.
Maxspareservers
Sets the maximum number of idle child processes, which defaults to 10. If there are currently more than maxspareservers of idle child processes, the parent process kills the extra child processes. Do not set this parameter too large. If you set the value of this directive to be smaller than Minspareservers, Apache will automatically modify it to "minspareservers+1".
MaxClients
Limit the number of client maximum access requests at the same time (number of concurrent threads per process), which defaults to 256. Any request exceeding the maxclients limit will enter the waiting queue, and once a link is freed, the request in the queue will be serviced. To increase this value, you must increase the serverlimit at the same time.
Maxrequestsperchild
The maximum number of requests that each child process allows for a servo during its lifetime, by default 10000. When the Maxrequestsperchild limit is reached, the child process will end. If Maxrequestsperchild is "0", the child process will never end. Setting Maxrequestsperchild to a value other than 0 has two benefits:
1. You can prevent (accidental) memory leaks from being carried out indefinitely, thus exhausting memory.
2. Give the process a limited lifespan, thus helping to reduce the number of active processes when the server load is reduced.
Server maximum number of connections "server reached maxclients Setting,consider raising the max clients setting"