A few days ago, the new idea shared the lifecycle of PHP script. Because I had to attend the company training that day, I did not share the lifecycle of the new idea. For some time in the past year, I was obsessed with PHP extensions and wanted to figure out how Apache called and executed PHP extensions. After studying for a long time, I had a general concept, but I didn't have a clear summary like this. Thanks to the PPT of the new idea.
Last night, I watched the new notebook ppt and found something different from what I used to know. In the DSO multi-process mode, the new supervisor mentions that the Apache main process initializes all the extension modules, and then fork out of the sub-process, each sub-process initializes all the extension modules once again. In my opinion, the initialization of the module only runs on the cloud once in the main process, and the sub-process will not perform the same operation.
I made an extension test and found that this is indeed the case, The child process will not initialize the extension module again..
However, another interesting thing was found during the verification process with the new supervisor. Although the sub-process did not perform the preliminary test function, each sub-process would execute the uninstall logic of the extension module. I didn't realize this before. In my concept, the initial trial and uninstallation logic of the extension module are all completed in the main process, and there is nothing to do with sub-processes.
The conclusion is: In DSO multi-process mode, the Mini of the extension module is executed only once in the main process, but mshutdown is executed once in all sub-processes.
Through the above conclusions, we can get such a note: we need to be very careful with the logic in the mshutdown, otherwise it is easy to occur in Apache stop or restart when the core dump occurs.
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