Questions about Apache's mpm-event parameters cannot be adjusted

Source: Internet
Author: User

After describing several of the Apache modes of operation, there are a number of problems with parameter tuning:

/usr/local/apache/bin/apachectl-k start after httpd service cannot start, error log errors:

[Fri 08 08:21:00.903245 2015] [Core:warn] [PID 29799:tid 140652774147840] Ah00098:pid File/usr/local/apache/logs/httpd.pid overwritten--unclean shutdown of previous Apache run? [Fri 08 08:21:00.913540 2015] [Mpm_event:notice] [PID 29799:tid 140652774147840]  ah00489:apache/2.4.2 (Unix) php/5.4.1 mod_fcgid/2.3.6 configured--resuming normal operations[fri may 08 08:21:00.913605 [Core:notice] [PID 29799:tid 140652774147840] Ah00094:command line: '/usr/local/apache/bin/httpd ' [Fri 08:21:00.916519] [Mpm_event:alert] [PID 30514:tid 14 0652574951168] (one) Resource temporarily unavailable:apr_thread_create:unable to create worker Thread[fri may 08 08:21:00 .916528] [Mpm_event:alert] [pid 30441:tid 140652574951168] (one) Resource temporarily unavailable:apr_thread_create : Unable to create worker Thread[fri 08:21:00.916537] [Mpm_event:alert] [pid 30311:tid 140652574951168] (one) Re Source temporarily unavailable:apr_thread_create:unable to create workEr threaderror in My_thread_global_end (): 1 threads didn ' t exiterror in My_thread_global_end (): 1 threads didn ' t exiterror In My_thread_global_end (): 1 threads didn ' t exit


This is actually caused by two reasons:

1. System kernel limitations, mainly max user processes, this parameter defaults to 1024, which means limiting the maximum process usage per user, and exceeding this limit will cause the HTTPD service to fail to start even if the MPM parameter is set correctly.

We set through Ulimit-u 102400来

For specific information, please refer to the http://blog.yufeng.info/archives/2568 article.

If set to boot, you need to change the/etc/security/limits.d/90-nproc.conf, this file nproc for the meaning of the process, the revision to

* Soft Nproc 102400

And then add Ulimit-u 102400 to the/etc/rc.local.

2. If some of the parameters are not set correctly, the HTTPD server cannot start, as for how to adjust the error log will be prompted.

Assuming that the kernel parameters are normal, we'll explain it in a mpm-event that can run but will have warn:

#<ifmodule mpm_event_module>#    serverlimit                100#    startservers         20#    minsparethreads        #   maxsparethreads      1200# threadsperchild    #    maxrequestworkers    # Maxconnectionsperchild  10000 #</ifmodule>
Threadsperchild default is 64, if you need to modify the settings Threadlimit, you must stop Apache before start, otherwise the configuration is invalid.

The maxsparethreads parameter settings need to be based on startservers*threadsperchild=1000, so maxsparethreads must be greater than 1000, in this case 1200, Otherwise, a startservers-maxsparethreads/threadsperchild process will be killed.

Maxrequestworkers parameter setting, need according to serverlimit*threadsperchild=5000, this out we set to 2000, boot will have warning, we follow the hint to change it to 5000.


If we find that the load on the server is a bit high, mostly httpd, and we have the remaining system resources, then we need to change our parameters.


In addition, if our Nginx reverse proxy httpd, and at this time httpd due to load processing related requests will enter the queue wait, this will cause nginx return 502 Bad Gateway, but this is due to the back-end server processing time-out caused by, We need to check our backend server for resolution.

Questions about Apache's mpm-event parameters cannot be adjusted

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.