LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   does ifconfig rx bytes counter have Max limit (https://www.linuxquestions.org/questions/linux-newbie-8/does-ifconfig-rx-bytes-counter-have-max-limit-396398/)

dimsh 12-25-2005 02:17 AM

does ifconfig rx bytes counter have Max limit
 
Hi,

I have made a PHP script that runs periodically and get the value of RX bytes and TX bytes from the output of `ifconfig eht0` command, then it subtract the current RX or TX bytes value from the previous RX or TX value and divide it by the nomber of seconds betwen the tow samples to get (Bytes/Sec) ratio.

I am using it from inside cacti on a running server which have 4 to 6 GB transfer per day.

I have noticed that I have got a negative result of the ratio, yesterday the TX bytes output was something like 2 GB and today it is 3 MB !.

so the counter flip to zero and continue counting when it reaches an upper limit.

I need to know what Max limit it has? is it 2 to the power of 32 as it is a 32bit counter. I want the excact number so I can fix my script and get acurate values.


Thanks.

Artanicus 12-26-2005 04:03 PM

Ive seen values as high as 4G someties, but not much larger than that.. There is a limit, tho I dont know what it exactly is.. 2^32 would seem to be around that neighbourhood, so thats prolly it. (2^32 / 1024 / 1024 = 4096)

dimsh 12-26-2005 05:07 PM

thanks , I have made the script to handle the value of 2^32-1 as the max limit.

it is working ok now.


All times are GMT -5. The time now is 03:40 AM.