nigoroll / libvmod-dynamic

The Varnish dns/named director continued
BSD 2-Clause "Simplified" License
95 stars 34 forks source link

the counter main.backend-unhealthy in varnishstat dont work when use the libvmod-dynamic #72

Closed yeurin closed 2 years ago

yeurin commented 3 years ago

hello, i'm using varnish 6.5.1, and libvmod-dynamic. and when i shut my backend define with the libvmod, varnish detect the unhealthy backend, switch to grace mode etc.. BUT, the counter MAIN.backend_unhealthy stay at 0. For information, i configured a health probe

is there anything to do to correct that ?

nigoroll commented 2 years ago

This is due to the fact that vmod_dynamic actually implements both a director and one backend per IP address the DNS records(s) point to. Because we do not want to direct traffic to unhealthy backends, we check the health state before returning a backend to varnish where the counter would be increased. What we could do is return the last checked backend to varnish, no matter if healthy or not. I will have a look...

nigoroll commented 2 years ago

This should work now.