[rrd-users] Re: counter overflow
Alex van den Bogaerdt
alex at ergens.op.het.net
Thu May 4 13:14:40 MEST 2006
On Thu, May 04, 2006 at 12:22:32PM +0200, Bohdan Linda wrote:
> I have a ISP provider, who has data limits. These limits are per month
> based. Thus I have created limit measurement based upon iptables and every
> month I zero the counter. So far ok.
You don't need to have a counter run from 0 to 99,999,999 to be aware
of reaching 100,000,000. 123,456,789 - 23,456,789 works equally well.
> I decided, that it would be nice also to monitor trafic. I am using the
> same values as for limits. But it has one drawback. When I zero the
> counters, rrdtool assumes that counter overflow occured and creates
> incredible traffic spike.
Indeed. Known "problem". (The problem is that reset, not the way the
program behaves).
Solution/workaround:
1) Just before the reset:
Perform your last update. Fetch the counter and tell RRDtool.
Then reset the device.
2) During the reset:
Perform a NaN update. Tell rrdtool to forget about its counter.
Perform a zero update. Tell rrdtool the current counter value is 0.
3) After the reset:
Do updates as usual. The first of them is compared against 0.
In the past, you could do one update per second. From an RRDtool
perspective the reset had to last for two seconds:
1: t-300 last regular update of the month
2: t-2 extra update
3: t-1 NaN update
4: t zero update, at day change
5: t+300 first regular update of new month
Between time "t-2" and time "t" you will have unknown data in your
database, this cannot be avoided if you reset your counter.
The timestamp for that update in (2) will not be accurate but usually
the error is small enough to be of no importance.
I wrote: "in the past". I am not sure yet how the new rrdtool, being
able to use sub-second precision, handles this.
> The question is, can I configure data source not to perfrom overflow checks?
Time "t": the counter is at 4294966996
Time "t+300": the counter is at 300.
What should rrdtool do with the interval between "t" and "t+300" ?
What is the rate it should store?
--
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list