Recommand · October 14, 2021 0

Varnish Pass – request coalescing

I have a varnish 4 setup with – nginx ssl termination -> varnish -> varnish rr to 4 apache backends

We need to basically not cache any requests where a specific cookie isn’t set on the incoming request, so in my vcl_recv I have:

if (!req.http.Cookie ~ "cookiename") {

This works fine initially, but as it is a busy site over time (10 mins or so) our backend failures, and busy sleep/wakeup are increasing, and we get 503s from varnish itself, but the backends are fine and don’t appear to be under any real load. Which makes me think that the requests are queued and sent sequentially to the backends and it skips any request coalescing.

I can’t really find anything to support this, is this the case? Or is there is a better way to do this? I would appreciate the feedback.