Is there even a point to having a healthcheck with only 1 backend in Fastly? What would it do if the backend became unavailable?


#1

Having a healthcheck with a single backend is still useful if you want to make changes to stale service windows. For instance, in vcl_recv, you could do:

if (backend.healthy) {
set req.grace = 5s;
} else {
set req.grace = 1d;
}

and then with an unhealthy backend, you would be able to serve stale objects for up to a day. This would require set beresp.grace = 1d regardless of the request grace period. This is the common case for using healthchecks with an individual backend. If stale service is not something you’d ever want to do, you can use backend.healthy as a means to send you into vcl_error early and serve a synthetic page somewhat nicer than the default varnish 503. This is nice in cases where the backend is timing out on connect or between bytes because it doesn’t rely on the client waiting for the timeout to occur before seeing an error.

Basically, any time you might need a logic switch to change response / routing decisions based on the responsiveness of your origin, having an actual healthcheck is useful.