7

I'm used to run

varnishadm -T localhost:6082 debug.health

to check the backends health status, but how can I check why a probe fails in details (eg timeouts, wrong http status code)?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Gabriele Perego
  • 113
  • 2
  • 2
  • 7

3 Answers3

7

In Varnish 4.0 you can see the status of all backends and their recent probe success rate with

varnishadm backend.list
T Percival
  • 8,526
  • 3
  • 43
  • 43
3

A little tricky to find [1] but:

Every poll is recorded in the shared memory log as follows:

NB: subject to polishing before 2.0 is released!

0 Backend_health - b0 Still healthy 4--X-S-RH 9 8 10 0.029291 0.030875 HTTP/1.1 200 Ok

...

Notice that the second word indicates present state, and the first word == "Still" indicates unchanged state.

  • 4--X-S-RH -- Flags indicating how the latest poll went
    • 4 -- IPv4 connection established
    • 6 -- IPv6 connection established
    • x -- Request transmit failed
    • X -- Request transmit succeeded
    • s -- TCP socket shutdown failed
    • S -- TCP socket shutdown succeeded
    • r -- Read response failed
    • R -- Read response succeeded
    • H -- Happy with result
  • 9 -- Number of good polls in the last .window polls
  • 8 -- .threshold (see above)
  • 10 -- .window (see above)
  • 0.029291 -- Response time this poll or zero if it failed
  • 0.030875 -- Exponential average (r=4) of responsetime for good polls.
  • HTTP/1.1 200 Ok -- The HTTP response from the backend.

So you should use varnishlog to get fail details.

[1] https://www.varnish-cache.org/trac/wiki/BackendPolling#SHMlog

NITEMAN
  • 1,236
  • 10
  • 11
  • Thanks @NITEMAN, it's still a bit tricky to me find the root couse of the problem: Backend_health - MainProd Still healthy 4--X--- 5 4 6 0.000000 0.145350 No HTTP status code or other hints about the error. Any idea on how to debug it? – Gabriele Perego Aug 06 '13 at 15:14
  • I've extended the documentation excerpt. In your case Varnish perform the request but the backend response never get back to Vanish, so most likely to be a time out. Better check backend logs for the probe results. – NITEMAN Aug 07 '13 at 10:38
  • Ok thanks a lot @NITEMAN I'll try to debug the issue on backend side. – Gabriele Perego Aug 07 '13 at 13:25
3

At least with varnish 4 you can also use this command for debugging the health probes:

varnishadm debug.health
Matthias
  • 141
  • 9