Re: [lvs-users] ipvsadm rate statistics

To: Andrew Hall <whippyhubbles@xxxxxxxxx>
Subject: Re: [lvs-users] ipvsadm rate statistics
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Thu, 4 Aug 2011 06:44:38 +0900
On Wed, Aug 03, 2011 at 10:50:30AM +0100, Andrew Hall wrote:
> would someone kindly provide a brief overview of how the traffic statistics
> are calculated with the ipvsadm rate flag - in particular InBPS and OutBPS.
> if that's outside the scope of this list then could you please answer just
> the following question: is the output always displayed in bytes and is it
> considered an accurate and reliable measure.


these statistics are maintained by the kernel.
The code to do so is in net/netfilter/ipvs/ip_vs_est.c in the kernel tree
which features the following comment.

  This code is to estimate rate in a shorter interval (such as 8
  seconds) for virtual services and real servers. For measure rate in a
  long interval, it is easy to implement a user level daemon which
  periodically reads those statistical counters and measure rate.
  Currently, the measurement is activated by slow timer handler. Hope
  this measurement will not introduce too much load.

  We measure rate during the last 8 seconds every 2 seconds:

    avgrate = avgrate*(1-W) + rate*W
    where W = 2^(-2)
  * The stored value for average bps is scaled by 2^5, so that maximal
    rate is ~2.15Gbits/s, average pps and cps are scaled by 2^10.

  * A lot code is taken from net/sched/estimator.c

The implementation itself is mainly in estimation_timer(), which updates
the statistics every 2s, and ip_vs_read_estimator(), which filters output
when it is read from user-space. Both of these functions are in

Please read the documentation before posting - it's available at: mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to

<Prev in Thread] Current Thread [Next in Thread>