netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <dada1@cosmosbay.com>
To: Mark Seger <Mark.Seger@hp.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: Why are network counters only updated once a second?
Date: Mon, 14 Jan 2008 21:45:33 +0100	[thread overview]
Message-ID: <478BC9ED.2000204@cosmosbay.com> (raw)
In-Reply-To: <478BC662.6030004@hp.com>

Mark Seger a écrit :
> I had mentioned this in my previous post but perhaps it might get more 
> attention all by itself.  I can't say for sure when this changed, but 
> for the longest time network counters were only updated once every 
> 0.9765 seconds and unless you used a tools like collectl that could 
> monitor at fractional intervals, your traffic was under-reported AND 
> you'd get periodic spikes of double the actual rate.  See 
> http://collectl.sourceforge.net/NetworkStats.html for a more complete 
> explanation.
> 
> Eventually the frequency became better aligned at a 1 second interval 
> because now the number look better, but the problem I see is that when 
> the sampling interval is very close to the monitoring interval you still 
> get periodic incorrect data.  Furthermore, you now need to know which 
> way the counters are updated before you pick a sampling interval!  But 
> the real point is if anyone ever wants to do finer grained monitoring, 
> say every 1/2 or even tenth of a second, they can't because the counters 
> won't change between samples.  Has this ever been discussed before?
> 

Yes it was discussed before. Some devices perform counters updates directly at 
the NIC level, and one in a while a transfert of counters is done to the host.

This is supposed to be better, especially on SMP.

Maybe you need to setup accounting rules with iptables, so that you can 
perform counter sampling at whatever rate you want ?


  reply	other threads:[~2008-01-14 20:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 20:30 Why are network counters only updated once a second? Mark Seger
2008-01-14 20:45 ` Eric Dumazet [this message]
2008-01-14 21:00   ` Mark Seger
2008-01-14 22:31 ` Michael Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478BC9ED.2000204@cosmosbay.com \
    --to=dada1@cosmosbay.com \
    --cc=Mark.Seger@hp.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).