Open dallyger opened 1 day ago
Do you know if that happens also with Nginx?
Setting a request_terminate_timeout
makes generally sense I think
@shyim Previously we've been using nginx on our Shopware 6.4 setup without any issues. Here is the config we've used: nginx.conf
Summary:
A request with the header "Transfer-Encoding: chunked" will cause Caddy to spawn a php_fastcgi process, which hangs forever.
After upgrading to Shopware 6.6 (using
shopware/docker
), our shop would timeout every couple hours/days due to bot traffic until manually restarted. Our old setup with nginx did not have that issue.Temporary solution
I've added the following entry to our Varnish config to block such requests:
Another option would be to set
request_terminate_timeout = 120s
inphp.conf
, so hanging requests are automatically terminated after two minutes.How to reproduce:
Setup a Shopware instance:
Start a docker container from an image build by using that project by adding the following to
compose.yaml
:And finally, send a broken request using
curl
:Request will hang and no body is returned:
Run the following command to observe an additional, forever open socket:
Repeat this 5 times (default value of
pm.max_children
) and the shop is unresponsive and any further requests will hang forever too, even if they're not chunked. Or a502 timeout
occurs, if behind a reverse proxy.See also
Some related issues I've found. However, I could not get the solutions mentioned to work yet. The
request_buffers 4k
setting did not work for me.