A detailed explanation of Linux Apache prefork and worker principles

Source: Internet
Author: User
Prefork (multi-process, each process produces child processes) and worker (multiple processes, each process generates more than one thread)
Prefork works by controlling the process after initially establishing a "startservers" sub-process, creating a process to meet minspareservers settings, waiting one second, continuing to create two, waiting one second, and continuing to create four ... This increases the number of processes created by the number of digits, up to 32 per second, until the value of the Minspareservers setting is met. This is the origin of pre-derivation (prefork).    This pattern eliminates the need to generate new processes when the request arrives, reducing overhead to increase performance. Worker is a new MPM in version 2.0 that supports multi-threaded and multi-process hybrid models. Because threads are used for processing, relatively large amounts of requests can be handled, and system resources are less expensive than process-based servers. However, workers also use multiple processes, and each process generates multiple threads to obtain stability based on the process server. This mpm's way of working will be the development trend of Apache 2.0. The current module of Apache can be viewed by command httpd-l, if the worker.c is working in worker mode, if PREFORK.C is working in PREFORK.C mode.

A detailed explanation of Linux Apache prefork and worker principles

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.