cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Allow Output Buffer Flushing with PHP-FPM

Sam Edwards shared this idea 2 years ago
Open Discussion

As a systems administrator, I would like the mod_proxy flushpacket parameter added as a default configuration so that PHP-FPM can flush the output buffer and increase TTFB for large pages, instead of doing so manually.


-------------------------------

Apache 2.4.31 added support for mod_proxy's flushpackets parameter to mod_proxy_fcgi: http://archive.apache.org/dist/httpd/CHANGES_2.4.32

This parameter is required for PHP-FPM to successfully flush the output buffer. This can lead to substantial increases in TTFB for large pages, or when the output buffer is manually flushed.

I've currently implemented this in local template overrides by adding the following line inside the [%- IF vhost.php_fpm %] block:

<Proxy "fcgi://[% wildcard_safe(vhost.servername) %]" flushpackets=on></Proxy>

I've had good results with this on a server with 150+ domains on PHP-FPM so far, so would like to suggest this be implemented as a default configuration. This functionality should already be present when using any other PHP handler, so this is really only bringing PHP-FPM up to parity with other handlers.

Replies (1)

photo
1

Since google has speed report in Search Console this topic is even more vital.

Google needs <1s FCP to be "Green". This can't be achived without partial output (flush) to the browser.

Google speed metrics explained

I think it would be nice to include on option for this at MultiPHP Manager / System PHP-FPM Configuration.

How I know a typical wordpress site outputs header line first, so this missing feature hits a lot of Sites!

Leave a Comment
 
Attach a file