5

I'm using Apache 2.4.43 on CentOS 7.8 with Varnish 6 and PHP-FPM to serve a Magento 2 website.

Varnish listens on port 80. Apache listens on 8080 to serve content to Varnish, and also port 443 which proxies HTTPS requests to Varnish like so:

ProxyPreserveHost On
ProxyPass         / http://127.0.0.1:80/
RequestHeader     set X-Forwarded-Port  "443"
RequestHeader     set X-Forwarded-Proto "https"

This works for most requests, however occasionally (~10% of requests) I receive a 503 response from Varnish and in turn from Apache. The only error I can see in Apache's logs is this one:

[proxy_http:error] [pid 6719:tid 140054596265728] (70008)Partial results are valid but processing is incomplete: [client x.x.x.x:53760] AH01110: error reading response, referer: http://example.com

If I retry the request it usually works immediately although occasionally I'll have to refresh a few times before the request will be fulfilled. I notice this happens more frequently when making large batches of requests (i.e. a page with hundreds of external assets on it). I also notice it seems to happen with larger files and not with tiny ones.

I am guessing it could be some kind of timeout but I'm not sure which values to adjust or how to further debug this.

Things I have tried include the following:

  • This answer involves changing a module I'm not using (Forge Rock OpenAm).
  • This one suggests disabling mod_reqtimeout which I tried and it did not help.
  • I have tried using KeepAlive Off which did not help.
  • I tried putting retry=0 at the end of ProxyPass which should apparently allow failed proxied connections to immediately retry but it didn't help

Any help is much appreciated.

WackGet
  • 187
  • 1
  • 12

0 Answers0