5.PHP kernel exploration: SAPI lifecycle of multiple processes/threads

Source: Internet
Author: User
Tags sapi
SAPI life cycle of multiple processes

PHP is usually compiled as a module of Apache to handle PHP requests. Apache will generally use multi-process mode, Apache will fork out many sub-processes, each process of memory space Independent, each sub-process will go through the start and end links, but the beginning of each process only after the process fork out, Multiple requests may be processed throughout the lifetime of the process. The shutdown phase occurs only when Apache is closed or the process is ended, and between these two phases begins with each request repeating the request-the link of the request shutdown.

Multi-process SAPI life cycle

Multi-threaded SAPI life cycle

The multithreading pattern is similar to a process in a multi-process, and the difference is that the request initiation-request closure is repeated in parallel throughout the life cycle of the process.

Multithreading SAPI life cycle

5.PHP kernel exploration: SAPI lifecycle of multiple processes/threads

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.