Apache two MPM prefork and worker differences

Source: Internet
Author: User

Apache defaults to a thread-safe prefork,prefork MPM that uses multiple child processes, each of which has one thread, each processing only one request connection at a time, and one request fails to affect other requests, which is thread-safe

Workers use multi-process multithreading, each with multiple threads, each processing a request connection, with higher performance, but non-thread-safe.

PHP's official recommendation does not use the thread of MPM, that is, threaded MPM, because PHP as a glue language, the dozens of third-party libraries to build a program, if there is a third-party library does not work properly, PHP needs to diagnose the problem and then fix it, When the underlying environment is not each separate process and completely separate memory distribution, there will be many destabilizing factors coming in.

If you need to handle a large number of requests, you can change Apache + mod_php to Nginx + php-fpm.

Http://httpd.apache.org/docs/2.2/mpm.html

http://www.nowamagic.net/librarys/veda/detail/1319/

Apache two MPM prefork and worker differences

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.