[mrtg] Re: Formula for calculating Network Utilisation

Alex van den Bogaerdt alex at ergens.op.het.net
Fri Jun 25 13:29:55 MEST 2004


On Thu, Jun 24, 2004 at 11:20:41PM -0700, Meng Keng Lee wrote:

> Perhaps I could explain better if I show you my MRTG conf:

> MaxBytes[A2RT01.Fa4_0_0.load]: 12500000

That is bytes.  It is also equal to 100000000 bits.

> >From the config above, I notice that the MaxBytes is 12500000 but using Getif ifSpeed is 100000000

Bytes vs. Bits.

> Just read from some Cisco docs last night, it says that the correct way
> of measure bandwidth is (ifInOctets X 8 X100) / (Number of seconds X ifSpeed).

And they are right, as long as you start counting from the moment the device
is switched on.  That is ___not___ 300 seconds.

Look at the formula again and recall your math lessons:

"ifInOctets"                      is in (bytes)
"ifSpeed"                         is in (bits/time).  
"Number of seconds"               is in (time)

"Number of seconds * ifSpeed"     is in (time * (bits/time))
                                  is in (bits * time/time)
                                  is in (bits * 1)
                                  is in (bits)

"ifInOctets * 8"                  is in (bits)



The maximum possible amount of data during a certain interval is
the maximum possible transfer rate, multiplied by the amount of time.

The real amount of data during a certain interval is in ifInOctets.

The following formulas are all the same:

                      real amount
percentage = 100 * ----------------
                   maximum possible

             100 * real amount
percentage = -----------------
             maximum possible

                   real amount
percentage = ----------------------
             maximum possible / 100

                    real amount
percentage = -----------------------
             maximum possible * 0.01



In stead of taking the whole amount of time since boot and the whole
amount of traffic since boot, you can also use the current amount minus
the previous amount.  This will calculate the percentage over a limited
amount of time; this is what MRTG does.

The amount of data is  (current_ifInOctets - previous_ifInOctets).
The amount of time is        (current_time - previous_time)

MRTG calculates this itself, you do not need do do this.  The formula
is the same.

Alex
-- 
I ask you to respect any "Reply-To" and "Mail-Follow-Up" headers.  If
you reply to me off-list, you'd better tell me you're doing so.  If
you don't, and if I reply to the list, that's your problem, not mine.

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list