Varnish High Availability

Monitoring

The following methods can be used to monitor VHA6.

varnishstat

To see your VHA6 statistics:

varnishstat -1 -f *vha6_stats*

The following metrics are logged:

  • broadcast_candidates - Requests evaluated for broadcasting.
  • broadcasts - Requests that have been broadcasted.
  • broadcast_skip - Requests that were skipped via a request override. See skip.
  • broadcast_nocache - Requests that could not be broadcasted due to uncacheability.
  • broadcast_lowttl - Request that could not be broadcasted due to low TTL and grace. See min_ttl and min_grace.
  • broadcast_toolarge - Requests that could not be broadcasted due to being too large. See max_bytes.
  • error_rate_limited - Transactions which hit the rate limit. See max_requests_sec.
  • fetch_peer - Broadcasts which hit this node and were converted to a peer fetch.
  • fetch_self - Broadcasts which hit the broadcasting node. These are expected for each broadcast.
  • fetch_origin - Fetches which hit this node as an origin from a peer.
  • fetch_origin_deliver - Fetches which successfully delivered an origin object to the peer.
  • fetch_peer_insert - Peer fetches which successfully inserted an object.
  • error_fetch_insert - Peer fetches which resulted in an origin error.
  • error_origin_mismatch - Origin recieved the wrong fetch.
  • error_origin_miss - Origin does not have the object.
  • error_version_mismatch - VHA6 versions do not match across nodes.
  • error_no_token - No token present in transaction.
  • error_bad_token - Invalid token present in transaction.
  • error_stale_token - A valid token is present but its expired. See token_ttl.
  • legacy_vha - A legacy vha-agent request was detected.

varnishlog

To see all VHA6 tranactions:

varnishlog -g request -q "ReqMethod ~ VHA"

To capture VHA6 errors:

varnishlog -g request -q "VHA6 ~ ERROR"

Responses

All peer responses have a vha6-origin header containing the origin hostname (server.identity).

To remove this header, add the following VCL:

sub vcl_deliver {
    unset resp.http.vha6-origin;
}