Varnishstat: bandwith usage

Dag-Erling Smørgrav des at
Mon Jun 11 23:35:15 CEST 2007

Andreas Røsdal <andrearo at> writes:
> I would expect 'Total header bytes' and 'Total header bytes' to be
> the total number of bytes sent to clients since varnishd was started?


> Measuring these numbers at different points in time could therefore be
> used to calculate the bandwith usage. So here are my measurements:
> * Initial values:
> 556874988  Total header bytes
> 20238688347  Total body bytes
> * 75 minutes later:
> 848969031  Total header bytes
> 30800272652  Total body bytes

A bit of simple arithmetic gives 10853678348 bytes (10 GB) served in 75
minutes, or 2411928 Bps, or 19295428 bps (19.3 Mbps) which is a fair
amount of traffic.

> The problem is that the correct values are 40 times larger than what I
> get from varnishstat.

How do you derive "the correct values"?  40 times what you have here is
nearly 800 Mbps, or twice as much as the daily average of Norway's most
visited web site (

> I notice that the total body bytes is larger than 2^32, perhaps there
> is an integer overflow somewhere?

No, these are 64-bit counters.

Perhaps there is an integer overflow in your calculator?  ;)

Dag-Erling Smørgrav
Senior Software Developer
Linpro AS -

More information about the varnish-misc mailing list