-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[RFC] enable thread safety (zts) for apache images; drop zts images #742
Comments
Oh nice; IMO this makes a ton of sense. Does PHP recommend one MPM or another, all other things being equal? We can also make |
The HTTP/2 guide states:
So atleast apache recommends |
https://www.reddit.com/r/PHP/comments/1jo517/multithreading_in_php_with_pthreads/cbhb3ix/ is interesting here -- there's definitely a performance decrease with simply enabling ZTS, and it's non-negligible (I've reproduced those tests, and my machine is significantly faster so the numbers are much lower, but it's still enough difference to make me anxious). I'm also worried about performance more than usual due to the resurgence of interest on #493, specifically the link to https://medium.com/@uv_d/migrating-our-php-applications-to-docker-without-sacrificing-performance-1a69d81dcafb which shows pretty clearly that we've already got some performance issues compared to Debian that I think we need to dig into and figure out what we're doing different. |
In researching more, I found https://blog.remirepo.net/post/2017/11/17/Fedora-27-changes-in-http-and-php (which is interesting by itself), but it links to https://secure.php.net/manual/en/install.unix.apache2.php which has the following warning:
And from that final link (https://secure.php.net/manual/en/faq.installation.php#faq.installation.apache2):
So the official PHP upstream recommendation is to not use |
(And of course, our own issue about PHP-FPM plus ZTS, #249, which links to https://github.com/krakjoe/pthreads#sapi-support) |
Related issue #249 is actually something I'm looking into right now. We have a Zend Application with some console commands that we would like to run through ZTS, while FPM normally deploys with NTS. I understand the use of these versions. It would've been nice though if there was an image already prepped that contained a executable for ZTS and NTS + FPM for these kind of applications. In #249 the user @j4r3kb is trying to do exactly the same as what I'm trying to realize. |
Since PHP's official recommendation with threaded MPMs is to use FPM instead of It'd be a drop-in replacement for WDYT? |
I'm definitely not keen on seeing more variants here -- we're already pretty out of control here. 😕 😞 |
Yes, I understand. There's an easier alternative, we can include FPM in RUN a2dismod mpm_prefork php7 && a2enmod mpm_event mod_proxy
CMD ["apache-fpm"] This gets us the best of both worlds: no performance penalty, while keeping one variant. The only drawback I see is increased image size. |
Interesting idea! I did a really rough build test, and it appears the size difference is ~15MB to enable FPM in the Apache build (~376MB before, ~391MB after), which seems pretty reasonable IMO. We could probably do that slightly simpler by crafting a configuration file that allows us to simply swap by providing a |
Great, I'll start working on it. |
I thought of it (I planned to use Maybe we could simply add those |
If we add
--enable-maintainer-zts
to thePHP_EXTRA_CONFIGURE_ARGS
then all three Apache MPMs become available: prefork, worker, and event.tests:
Apache will start with any of the three MPMs (used event as default).
We'll leave the default on the current
mpm_prefork
and note how to swap:We should also be able to do away with the plain
-zts
variants, since the cli can still be found in theapache
image.What effect will this have on Apache
mpm_prefork
?Should we later migrate to
mpm_event
?Other questions, concerns?
notes:
The text was updated successfully, but these errors were encountered: