Take the 2-minute tour ×

I have varnish installed and I think it's working properly (not sure if it matters but I am using iptables reroute method to route ports incoming:80 > varnish:8080 > apache:80

Anyway, In varnishstat I see a pretty high Hitrate average (60-80%) which I am working on but I am unclear at what all of the stats presented by varnishstat

Specifically the following Backend stats:

380         0.00         0.26 Backend conn. success
10122      15.00         6.85 Backend conn. reuses
267         0.00         0.18 Backend conn. was closed
10391      15.00         7.04 Backend conn. recycles

I've read a blog post called "Varnishstat for dummies" which outlines a lot of details of varnishstat (I recommend it for beginners) but it does not go over these Backend stats.

Feel free to explain here or link to a resource I've missed :)


share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

The first number ("Backend connections initiated") is the total number of (TCP socket) connections that has been opened from Varnish to the backend. This number is a counter.

"Backend connections recycled" is increased whenever we have a keep-alive connection that is put back into the pool of connections. It has not yet been used, but it might be, unless the backend closes it.

"Backend connections reused" is increased whenever we actually reuse a connection from the pool of backend connections.

Last, "Backend connections unused", are the number of available connections at any given time. This number is an absolute number, and will increase and decrease during operation.

Source : https://www.varnish-cache.org/trac/wiki/StatsExplained

share|improve this answer
add comment

ok, so from thinking about it, i have the following theory on what each of these mean:

  1. Backend conn. Success: number of connections that required a backend connection (to apache in your case) and got a response
  2. Backend conn. Reuses: number of connections which needed a backend connection, and used one that was already open, reducing the creation and tear down of the connection...
  3. Backend conn. was closed: not 100% sure on this, but I think it might be connection that were either closed before data came back (error) or a connection that Varnish though was open, but was closed by the time it tried to connect...
  4. Backend conn. recycles: number of connections that needed to be re-opened by varnish to the backend server.

Hopefully this makes sense... other than the closed one, i am about 99% sure on the rest.

share|improve this answer
You know what? That might just be it :) Thanks for taking the time and I'll continue the search & report as I go –  electblake Jun 21 '11 at 20:12
add comment

Your Answer


