Understanding 503s

Dridi Boukelmoune dridi at varni.sh
Thu Apr 15 08:14:30 UTC 2021


On Thu, Apr 15, 2021 at 7:27 AM Maninder Singh <mandys at gmail.com> wrote:
>
> Thank you Dridi.
> This is very helpful.
>
> FYI - My apache keepalive is
> KeepAliveTimeout 3
>
> You would suggest increasing this to 5-10 ?

If varnish is httpd´s only client then increase it to 70s. Varnish
will close unused connections after 60s by default, and if it´s really
really busy that gives a 10s window for the actual shutdown to happen.

If there are other direct clients in front of your httpd server, then
decrease backend_idle_timeout in varnishd to 2s, but then you will
force varnish to establish connections more often. This is already the
case of course, but at least that will reduce the risk of reusing a
closed connection and failing backend fetches for this reason.

> We had lowered the KeepAliveTimeout as the server is a very busy one and we want to handle many connections.

I understand, and there´s a good reason to have a low default when you
can´t trust the clients. It boils down to whether your httpd server is
openly accessible to more than just varnish, including potentially
malicious clients.

Dridi


More information about the varnish-misc mailing list