Apache [ERROR] server reached maxclients setting, consider raising the maxclients setting

Source: Internet
Author: User
Tags apache log

Recently the company has a customer reported a problem, that is, after running for a while in the Apache log/var/log/httpd/error_log file has an error message

[Fri 29 15:45:37 2016] [ERROR] Server reached maxclients setting, consider raising the maxclients setting

Check, this is due to the number of concurrent links caused by too many, and then check the Apache documentation, found that you can modify the Apache configuration file

The maxclients parameters in the /etc/httpd/conf/httpd.conf are adjusted.

Before adjusting, first check to see if Apache runs in which mode is prefork or worker, use the "/usr/sbin/httpd-l" command to check, when checked out which mode , you can find the corresponding configuration section in/etc/httpd/conf/httpd.conf to modify it.

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

Modify the parameters to

<ifmodule prefork.c>  
startservers       8  
minspareservers    5  
maxspareservers  
Serverlimit      256  
maxclients       256  
maxrequestsperchild  4000  

Amended to

<ifmodule prefork.c>  
startservers     8  
minspareservers  5  
maxspareservers  20  
serverlimit     1024  
maxclients      1024  
maxrequestsperchild  
</IfModule>

Then restart the Apache "service httpd restart".

The meaning of the parameters, in the configuration of Apache is described in detail, as follows:

# prefork MPM # Startservers:number of server processes to start # minspareservers:minimum number O F server processes which are kept spare # maxspareservers:maximum number of server processes which are kept spare # S  Erverlimit: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 # Startserv Ers:initial number of server processes to start # Maxclients:maximum number of simultaneous client connections # Min Sparethreads: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 the each server process # Maxrequestsperchild : Maximum number of requests a server process serves 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.