From owner-freebsd-arch Mon Jan 14 8:47:34 2002 Delivered-To: freebsd-arch@freebsd.org Received: from technokratis.com (modemcable099.144-201-24.mtl.mc.videotron.ca [24.201.144.99]) by hub.freebsd.org (Postfix) with ESMTP id AA5EC37B405; Mon, 14 Jan 2002 08:47:20 -0800 (PST) Received: (from bmilekic@localhost) by technokratis.com (8.11.4/8.11.3) id g0EGnBj25064; Mon, 14 Jan 2002 11:49:11 -0500 (EST) (envelope-from bmilekic) Date: Mon, 14 Jan 2002 11:49:11 -0500 From: Bosko Milekic To: "James E. Housley" Cc: Terry Lambert , Thomas Hurst , arch@FreeBSD.org Subject: Re: 64 bit counters again Message-ID: <20020114114911.A24990@technokratis.com> References: <3C41F3FD.4ECC8CD@mindspring.com> <20020113231459.GA30349@voi.aagh.net> <3C42390A.F9E9F533@mindspring.com> <3C42E899.CB21BD0A@FreeBSD.org> <20020114105859.A24635@technokratis.com> <3C4305E5.65BB32A6@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C4305E5.65BB32A6@FreeBSD.org>; from jeh@FreeBSD.org on Mon, Jan 14, 2002 at 11:23:01AM -0500 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Jan 14, 2002 at 11:23:01AM -0500, James E. Housley wrote: > Bosko Milekic wrote: > > > Right now I am trying to do network usage on the overflows the 32 bit > > > counters in 60 120 seconds. That means the netstat values are useless, > > > mrtg and other programs that poll for results every 5 minutes or so are > > > useless. If I want to get good data I have to get the counts every 10 > > > seconds or so to get reasonable results. > > > > You know, if you have a counter overflowing in 60 to 120 seconds, > > then perhaps what it's counting should not be counted to begin with. > > I am just trying to count bytes in and out, too keep track of usage and > head off a large overage and a larger bill then necessary. Counting > packets is worthless. But just do the math. With a GigE NIC, at what > data rate do you start overflowing the counters too quickly. I suppose > there is another possibility, that the ti GigE driver is counting the > data multiple times. But I don't think so, because at 200Mbits/sec the > counter should overflow in 172 seconds. And this machine is easily > doing this most of the day. You're going to run into the same problem with a 64-bit counter, as Terry pointed out. You're just going to end up moving the time it takes from 172 seconds to some other, slightly longer, although equally unreasonable, time. Instead of counting bytes, perhaps you should count K or M Bytes. Just take the delta you're about to add to your counter and divide it by something reasonable before adding it. If you are really bent on getting accurate results, maintain a separate counter and sum remainders in it. I'm sure you'll get slightly more accurate data while not changing all counters to be 64-bits wide on non-64 bit platforms (i.e., you'll keep the added execution time local to that specific code you're working on). [...] > That all sounds reasonable. And it make sense to move the counters > under existing locks. But, 32-bit machines are going to be around for > awhile longer and fast network connections are going to get faster and > more common. Maybe the counters should be completely removed from the > 32-bit arch.s since they give such misleading results and only have them > on the 64-bit machines. That way no one will be confused by the data. > > Of course I am not completely serious about removing the counters, but > it is not hard to make them very wrong. I still think that this sort of data should not be counted, but if it should, having a 64-bit counter won't fix your problem, ultimately; besides for allowing you to run mrtg at longer intervals (and that's no solution; in fact, you can do that even with 32-bit counters as long as you had a second daemon cook your mrtg data files for you by having the daemon execute much more often and just perform sysctls and produce deltas. It could then flush the deltas to the data file every 5 minutes or so, and you can have mrtg run at every 5 minutes, 30 seconds so regardless, you are just stuck with the same problem, ultimately, even with 64-bit counters in this case). > Jim > -- > /"\ ASCII Ribbon Campaign . > \ / - NO HTML/RTF in e-mail . > X - NO Word docs in e-mail . > / \ ----------------------------------------------------------------- > jeh@FreeBSD.org http://www.FreeBSD.org The Power to Serve > jim@TheHousleys.Net http://www.TheHousleys.net > jhousley@SimTel.Net http://www.SimTel.Net > --------------------------------------------------------------------- > PC hardware is the ductape of the computer inustry... -- Bosko Milekic bmilekic@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message