Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't involve PHP in Apache mpm_winnt control process #7865

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmb69
Copy link
Contributor

@cmb69 cmb69 commented Jan 1, 2022

Apache mpm_winnt uses a single control process which launches a single
child process which in turn creates threads to handle requests. Since
the child process is not forked, but rather spawned, and the control
process is never involved in request handling, there is no need to
power up PHP for the control process. Besides not doing this saves
some resources, we no longer have to deal with potential re-attaching
to OPcache shared memory which avoids issues due to ASLR, and paves the
way to further improvements (such as preloading support for Apache
mpm_winnt).


Possibly, a problem with that exact implementation is that it assumes that mpm_winnt is always used on Windows, what might be wrong. Maybe someone knowlegable with Apache on Windows can clarify whether alternative MPMs might be used there, and if so, suggest a better way to detect that (i.e. is there a respective macro we could use in favor of PHP_WIN32)?

cc @Jan-E

Apache mpm_winnt uses a single control process which launches a single
child process which in turn creates threads to handle requests.  Since
the child process is not forked, but rather spawned, and the control
process is never involved in request handling, there is no need to
power up PHP for the control process.  Besides not doing this saves
some resources, we no longer have to deal with potential re-attaching
to OPcache shared memory which avoids issues due to ASLR, and paves the
way to further improvements (such as preloading support for Apache
mpm_winnt).
@Jan-E
Copy link
Contributor

Jan-E commented Jan 1, 2022

Hi Christoph,
In my case mpm_winnt is always used, either on my dev laptop, on a staging server or in production.
I have asked it on Apachelounge:
https://www.apachelounge.com/viewtopic.php?t=8818
Maybe there are odd configs out there with an alternative MPM.

@Jan-E
Copy link
Contributor

Jan-E commented Jan 2, 2022

@wrowe Are you aware of Apache setups on Windows with an alternative MPM ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants