rfc:socketactivation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:socketactivation [2012/10/18 19:00] – [Changelog] davidstrauss | rfc:socketactivation [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2012-10-17 | * Date: 2012-10-17 | ||
* Author: David Strauss < | * Author: David Strauss < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
* Patches: [[rfc/ | * Patches: [[rfc/ | ||
Line 9: | Line 9: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Linux distributions with systemd support a " | + | Linux distributions with systemd support a " |
+ | |||
+ | ===== Benefits ===== | ||
+ | |||
+ | Supporting this in PHP-FPM | ||
launchd and legacy internet superservers support socket activation in similar ways. | launchd and legacy internet superservers support socket activation in similar ways. | ||
Line 15: | Line 19: | ||
Socket activation creates no overhead once the daemon has started. systemd does not proxy any traffic; it just hands over the file descriptor. Once the daemon is running and using the systemd-provided socket(s), there' | Socket activation creates no overhead once the daemon has started. systemd does not proxy any traffic; it just hands over the file descriptor. Once the daemon is running and using the systemd-provided socket(s), there' | ||
+ | Socket activation allows replacing the entire binary (as with a PHP-FPM security update) without interrupting listening on the socket. PHP-FPM supports reloading to a limited degree, but it doesn' | ||
+ | |||
+ | There is work underway to have socket activation on the base system spawn or start full containers (like LXC) on-demand. Since PHP-FPM will, itself, be in the container, something else needs to listen on its behalf. | ||
+ | |||
+ | Finally, it's a platform consistency issue. As more services move to socket activation in Fedora, Arch, Suse, and Red Hat Enterprise Linux (and its derivatives), | ||
===== Implementation details ===== | ===== Implementation details ===== | ||
Line 52: | Line 61: | ||
==== / | ==== / | ||
+ | |||
+ | It's possible the final implementation may move to " | ||
< | < | ||
Line 74: | Line 85: | ||
systemctl start my-php-fpm-pool.socket | systemctl start my-php-fpm-pool.socket | ||
</ | </ | ||
+ | |||
+ | ===== Potential Objections ===== | ||
+ | |||
+ | ==== Why not just use the ondemand process manager? ==== | ||
+ | |||
+ | The ondemand process manager still keeps considerable memory allocated, and PHP-FPM currently has some idle CPU load when not processing requests. It's <1% of a core per service, but it adds up when you manage 500+ pools, each as a service for security/ | ||
+ | |||
+ | The ondemand process manager doesn' | ||
+ | ==== What about Upstart support? ==== | ||
+ | |||
+ | Upstart seems to have basic socket activation support, and integrating PHP-FPM with it would be a great follow-on project. All socket activation basically works the same way, in the sense of a file descriptor getting handed into the daemon. This RFC would pave the way for integration into additional superserver and init daemons. | ||
+ | |||
+ | ==== What about APC opcode cache efficiency? ==== | ||
+ | |||
+ | In order for pools to share an opcode cache they must be forked from the same parent process. There are ways to work around that, but it requires some fancy fd passing footwork in APC and I guess in many instances you don't actually want to share across pools anyway. (Abbreviated from Rasmus on PHP internals) | ||
===== Changelog ===== | ===== Changelog ===== | ||
- | 2012-10-18: Patches added. | + | * 2012-11-09: Explain a minor configuration change possibility to harmonize this proposal with the one for nginx. |
- | 2012-10-17: Initial version. | + | * 2012-10-18: Integrate discussion items from the PHP internals list. |
+ | * 2012-10-18: Patches added. | ||
+ | |
rfc/socketactivation.1350586812.txt.gz · Last modified: 2017/09/22 13:28 (external edit)