2

Browsers are waiting for max keepalive time for symfony homepage.

If I disable Keepalive (apache), it's ok. The reponse header "Connection: Close" is received and the browser stop waiting. Total Time is near 200ms.

If I enable Keepalive (apache), headers response are :

Connection: Keep-Alive
Keep-Alive: timeout=5, max=500
Transfer-Encoding: chunked

No 'Content-Encoding' header
No 'content-length' header (keep alive)

Php.ini :

output_buffering = 4096

I'm using php-fpm on a remote server. Here is apache configuration :

ProxyPassMatch ^/(..php(/.)?)$ fcgi://192.168.1.1:9000/var/php-fpm/www/public/$1

The browser received data but is waiting for 5s. It seems the browser is waiting for the end of chunked data (last 0 size packet).

The web server is apache2.4.6, code is php7.1.8/synfony 4. The same code in a developpement environnement works fine (another host).

The execution time in apache logs is near 20ms (not 5s !). The browser waits the end of transfer and stops with keepalive timeout. If I set 20s for keepalive timeout, the browsers waits 20s after receiving data.

Symfony performance metric 'Total execution time' is 18ms (in dev mode). Internet Explorer timeline (F12) shows 5.35ms with 5s for 'response time' at the end of detail.

If I get a simple page (phpinfo), I have not the problem, it is with symfony homepage and only with production server.

A simple test with curl (no ajax, js...) shows the problem : data are received totaly (</html>) but curl is still waiting 5s and writes the message :

transfer closed with outstanding read data remaining

instead of :

Connection #0 to host xxxxxxx left intact

If I disable ssl apache virtual host and I test with Fiddler, Fiddler shows this error message when I click to decode response body :

chunked body did not terminate properly with 0-sized chunk

Is there a php chunk problem with php/synfony ?

Thank you very much.

1 Answers1

1

I have solved my problem. The directive "FallbackResource" in apache causes this "chunk" problem. This option allows to disable AllowOverride and .htaccess usage and ask Apache web server to redirect all requests to one page (no need DirectoryIndex anymore). But it seems it is not compatible with KeepAlive for the index page. I don't know if it is an apache bug.

  • It seems it is a bug : http://apache-http-server.18135.x6.nabble.com/Bug-58292-New-FallbackResource-breaks-chunked-encoding-sometimes-td5023539.html – Fabien Sintès Mar 01 '19 at 12:11