From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ia0-x22c.google.com (mail-ia0-x22c.google.com [IPv6:2607:f8b0:4001:c02::22c]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 6449321F196 for ; Thu, 24 Jan 2013 21:01:09 -0800 (PST) Received: by mail-ia0-f172.google.com with SMTP id u8so6017439iag.17 for ; Thu, 24 Jan 2013 21:01:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=487DieKr6GDa7GUdOmzq4aiyg5y5k8HSprMOG1n+J0c=; b=P8GS0WqDW3MlpuYEEr9jzxDDMcUEJ80eY7+6VYiEoziXNaxvVvPCrW5mubxYbeMI8X 0+R/2sxQRyOGRiXsqCjz/XqhRah0Hdr3KrvAZLchikdQu3MFGOeXkJmKV35AMDdaZI7w vB22dE1375FUaGs08uB2XrMq1RE1JVFEYVYu2oHZ96Nhj/sq0RdW6QwqMqgaeoKhB6kM 4NKrquNkHO2JQ7w6pri8PN8ZlzyqMjt2vP74E2qCtmnqXCFk2+iaDqvYsEC/8kYCFQEG PRzOQ5Pqn1sAwX1W2V1H2EGmeM5VOQYMGG8Hv3On5QxoZ5b9wfXF3bcLQr2ClnfjjQVC 8LLg== MIME-Version: 1.0 X-Received: by 10.50.88.136 with SMTP id bg8mr3148016igb.96.1359090068503; Thu, 24 Jan 2013 21:01:08 -0800 (PST) Received: by 10.64.135.39 with HTTP; Thu, 24 Jan 2013 21:01:08 -0800 (PST) In-Reply-To: References: Date: Fri, 25 Jan 2013 00:01:08 -0500 Message-ID: From: Dave Taht To: Justin Madru Content-Type: multipart/alternative; boundary=e89a8f235a17c03b0104d415d097 Cc: cerowrt-devel@lists.bufferbloat.net Subject: Re: [Cerowrt-devel] Network device transfer counter loops at 4GB X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 05:01:09 -0000 --e89a8f235a17c03b0104d415d097 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable The 32 bit counter problem is kind of legacy. I'm not even sure what layer of the stack it's at. Perhaps better counters are in /sys/class/net or elsewhere. On Thu, Jan 24, 2013 at 11:44 PM, Justin Madru wrot= e: > Thanks for the reply. I'll take a look at vnstat. It still seems like > making the counters 64bit would be a better out-of-the-box solution, > especially since the web-ui is displaying these values which are nearly > useless. > To know someone other than me has pushed more than 4GB through cerowrt is quite comforting, actually.... > > > --Justin > > > On Thu, Jan 24, 2013 at 9:40 AM, Sebastian Moeller wrote= : > >> Hi Justin, >> >> have a look at vnstat and vnstati if you want to keep a better overview >> of Rx/Tx volumes over time=85 (Then again, it might not be what you are >> looking for) >> >> best >> Sebastian >> >> >> On Jan 24, 2013, at 00:55 , Justin Madru wrote: >> >> > Hi, >> > >> > I noticed that the TX/RX counter as reported by ifconfig and in the we= b >> ui loop over at 4GB (2^32). Is this something that could be fixed? >> >> Just guessing here, but that smells like a 32bit counter which >> might be involved to change to 64bit. So you could just periodically rea= d >> out the value and compare to your last value to detect overruns (assumin= g >> you sample at a period smaller than the shortest possible roll-over time= ). >> Then again this seems what vnstat is doing. >> >> > Interestingly, the ifb0 device (what ever that is) does not have this >> issue. >> >> >> http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb >> >> > It would be nice to know the amount of data I've transferred at least >> for GE00. >> >> Me =3D broken record: have a look at the vnstat and vnstati pack= ed >> that are part of the cerowrt repository that Dave maintains (THANKS A LO= T) >> >> If you should go the vnstat route here is what I ended up with (nothing >> fancy, but it seems to work okay): >> >> Here is my System->Startup-> local startup (can be pasted into the lucy >> text box) >> >> # Put your custom commands here that should be executed once >> # the system init finished. By default this file does nothing. >> >> #manual vnstat updates... since vnstat logs to tmpfs re-init the databas= e >> mkdir /var/lib/vnstat >> vnstat -u -i ge00 >> >> # start the traffic shaping script on startup... >> #/usr/sbin/simple_qos.sh >> >> >> # be verbose in dmesg and log >> echo 1 1 1 1 > /proc/sys/kernel/printk >> # helps unaligned access errors show up in log >> #echo 2 > /sys/kernel/debug/mips/unaligned_action >> >> # to make vnstat robust against reboots (to monitor volume caps) >> # this will copy the saved vnstat database over the just initialized >> (more or less empty db) >> /etc/init.d/vnstatbackup restore >> >> # minimize the too large tmpfs (to avoid OOM), this is better handled by >> adding swap >> # might interfere with sys upgrade procedure (default is ram/2 IIRC >> mount tmpfs /tmp -t tmpfs -o remount,size=3D16000k,nosuid,nodev >> >> exit 0 >> >> >> and here is /etc/init.d/vnstatbackup: >> >> #!/bin/sh >> ## Please visit http://wiki.openwrt.org/doc/howto/vnstat >> # 20121008sm: automate parsing of vnstat related information >> # place this script in /etc/init.d >> # make it executable: chmod 755 /etc/init.d/vnstatbackup >> # 4 CRON: echo "*/30 * * * * /etc/init.d/vnstatbackup backup" >> >> /etc/crontabs/root >> # /etc/init.d/cron restart >> # 4 INIT add >> # /etc/init.d/vnstatbackup restore >> # to /etc/rc.local >> >> >> # edit this to point to where you stored the db >> BACKUP_BASE_DIR=3D"/home/persistent" # where to store the database >> backup >> >> # for vnstat have a look at /etc/vnstat.conf (code taken from >> /etc/init.d/vnstat) >> vnstat_option() { >> sed -ne "s/^[[:space:]]*$1[[:space:]]*['\"]\([^'\"]*\)['\"].*/\1/p" = \ >> /etc/vnstat.conf >> } >> VNSTAT_DB_DIR=3D"$(vnstat_option DatabaseDir)" >> VNSTAT_BASE_DIR=3D`dirname ${VNSTAT_DB_DIR}` #${VNSTAT_DB_DIR%/*} >> VNSTAT_SUB_DIR=3D`basename ${VNSTAT_DB_DIR}` #"vnstat" >> >> #echo "VNSTAT_DB_DIR ${VNSTAT_DB_DIR}" >> #echo "VNSTAT_BASE_DIR ${VNSTAT_BASE_DIR}" >> #echo "VNSTAT_SUB_DIR ${VNSTAT_SUB_DIR}" >> #echo "BACKUP_BASE_DIR ${BACKUP_BASE_DIR}" >> >> case $1 in >> backup) >> cp -r ${VNSTAT_BASE_DIR}/${VNSTAT_SUB_DIR} ${BACKUP_BASE_DIR} >> ;; >> restore) >> cp -r ${BACKUP_BASE_DIR}/${VNSTAT_SUB_DIR} ${VNSTAT_BASE_DIR} >> ;; >> *) >> echo "Please use 'backup' or 'restore' parameter for run"; >> ;; >> esac >> >> exit 0 >> >> Note that I mounted a USB stick under /home to have plenty of space, but >> you should also be able to use the persistent overlay part of cerowrt >> (where config files and such are stored) but that will stress the precio= us >> flash (a usb stick, by virtue of being replaceable and cheap is just les= s >> precious). >> >> Finally System->Scheduled Tasks: >> >> */5 * * * * vnstat -u >> */30 * * * * /etc/init.d/vnstatbackup backup >> >> The first polls the Rx/Tx counters every 5 minutes (if your link is very >> fast you might want to reduce that) >> The second pushes the vnstat database every 30 minutes to the stick. The >> idea here is that you might want vnstat to do something even when the st= ick >> is (accidentally) removed. >> >> best >> Sebastian >> >> >> > >> > --Justin Madru >> > _______________________________________________ >> > Cerowrt-devel mailing list >> > Cerowrt-devel@lists.bufferbloat.net >> > https://lists.bufferbloat.net/listinfo/cerowrt-devel >> >> > > _______________________________________________ > Cerowrt-devel mailing list > Cerowrt-devel@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cerowrt-devel > > --=20 Dave T=E4ht Fixing bufferbloat with cerowrt: http://www.teklibre.com/cerowrt/subscribe.html --e89a8f235a17c03b0104d415d097 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
The 32 bit counter problem is kind of legacy. I'm not even sure wh= at layer of the stack it's at. Perhaps better counters
are in= /sys/class/net or elsewhere.

On T= hu, Jan 24, 2013 at 11:44 PM, Justin Madru <justin.jdm64@gmail.com> wrote:
Thanks for the reply. = I'll take a look at vnstat. It still seems like making the counters 64b= it would be a better out-of-the-box solution, especially since the web-ui i= s displaying these values which are nearly useless.

To know someone other than me has pushed = more than 4GB through cerowrt is quite comforting, actually....
=A0


--Justin


On Thu, = Jan 24, 2013 at 9:40 AM, Sebastian Moeller <moeller0@gmx.de> w= rote:
Hi Justin,

have a look at vnstat and vnstati if you want to keep a better overview of = Rx/Tx volumes over time=85 (Then again, it might not be what you are lookin= g for)

best
=A0 =A0 =A0 =A0 Sebastian


On Jan 24, 2013, at 00:55 , Justin Madru wrote:

> Hi,
>
> I noticed that the TX/RX counter as reported by ifconfig and in the we= b ui loop over at 4GB (2^32). Is this something that could be fixed?

=A0 =A0 =A0 =A0 Just guessing here, but that smells like a 32bit coun= ter which might be involved to change to 64bit. So you could just periodica= lly read out the value and compare to your last value to detect overruns (a= ssuming you sample at a period smaller than the shortest possible roll-over= time). Then again this seems what vnstat is doing.

> Interestingly, the ifb0 device (what ever that is) does not have this = issue.

=A0 =A0 =A0 =A0 http://www.linuxfoundation.or= g/collaborate/workgroups/networking/ifb

> It would be nice to know the amount of data I've transferred at le= ast for GE00.

=A0 =A0 =A0 =A0 Me =3D broken record: have a look at the vnstat and v= nstati packed that are part of the cerowrt repository that Dave maintains (= THANKS A LOT)

If you should go the vnstat route here is what I ended up with (nothing fan= cy, but it seems to work okay):

Here is my System->Startup-> local startup (can be pasted into the lu= cy text box)

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

#manual vnstat updates... since vnstat logs to tmpfs re-init the database mkdir /var/lib/vnstat
vnstat -u -i ge00

# start the traffic shaping script on startup...
#/usr/sbin/simple_qos.sh


# be verbose in dmesg and log
echo 1 1 1 1 > /proc/sys/kernel/printk
# helps unaligned access errors show up in log
#echo 2 > /sys/kernel/debug/mips/unaligned_action

# to make vnstat robust against reboots (to monitor volume caps)
# this will copy the saved vnstat database over the just initialized (more = or less empty db)
/etc/init.d/vnstatbackup restore

# minimize the too large tmpfs (to avoid OOM), this is better handled by ad= ding swap
# might interfere with sys upgrade procedure (default is ram/2 IIRC
mount tmpfs /tmp -t tmpfs -o remount,size=3D16000k,nosuid,nodev

exit 0


and here is /etc/init.d/vnstatbackup:

#!/bin/sh
## Please visit http://wiki.openwrt.org/doc/howto/vnstat
# 20121008sm: automate parsing of vnstat related information
# place this script in /etc/init.d
# make it executable: chmod 755 /etc/init.d/vnstatbackup
# 4 CRON: echo "*/30 * * * * /etc/init.d/vnstatbackup backup" >= ;> /etc/crontabs/root
# =A0 =A0 =A0 /etc/init.d/cron restart
# 4 INIT add
# /etc/init.d/vnstatbackup restore
# to /etc/rc.local


# edit this to point to where you stored the db
BACKUP_BASE_DIR=3D"/home/persistent" =A0 =A0 =A0# where to store = the database backup

# for vnstat have a look at /etc/vnstat.conf (code taken from /etc/init.d/v= nstat)
vnstat_option() {
=A0 =A0 sed -ne "s/^[[:space:]]*$1[[:space:]]*['\"]\([^'\= "]*\)['\"].*/\1/p" \
=A0 =A0 /etc/vnstat.conf
}
VNSTAT_DB_DIR=3D"$(vnstat_option DatabaseDir)"
VNSTAT_BASE_DIR=3D`dirname ${VNSTAT_DB_DIR}` #${VNSTAT_DB_DIR%/*}
VNSTAT_SUB_DIR=3D`basename ${VNSTAT_DB_DIR}` #"vnstat"

#echo "VNSTAT_DB_DIR ${VNSTAT_DB_DIR}"
#echo "VNSTAT_BASE_DIR ${VNSTAT_BASE_DIR}"
#echo "VNSTAT_SUB_DIR ${VNSTAT_SUB_DIR}"
#echo "BACKUP_BASE_DIR ${BACKUP_BASE_DIR}"

case $1 in
=A0 =A0 backup)
=A0 =A0 =A0 =A0 cp -r ${VNSTAT_BASE_DIR}/${VNSTAT_SUB_DIR} ${BACKUP_BASE_DI= R}
=A0 =A0 =A0 =A0 ;;
=A0 =A0 restore)
=A0 =A0 =A0 =A0 cp -r ${BACKUP_BASE_DIR}/${VNSTAT_SUB_DIR} ${VNSTAT_BASE_DI= R}
=A0 =A0 =A0 =A0 ;;
=A0 =A0 *)
=A0 =A0 =A0 =A0 echo "Please use 'backup' or 'restore'= parameter for run";
=A0 =A0 =A0 =A0 ;;
esac

exit 0

Note that I mounted a USB stick under /home to have plenty of space, but yo= u should also be able to use the persistent overlay part of cerowrt (where = config files and such are stored) but that will stress the precious flash (= a usb stick, by virtue of being replaceable and cheap is just less precious= ).

Finally System->Scheduled Tasks:

*/5 * * * * vnstat -u
*/30 * * * * /etc/init.d/vnstatbackup backup

The first polls the Rx/Tx counters every 5 minutes (if your link is very fa= st you might want to reduce that)
The second pushes the vnstat database every 30 minutes to the stick. The id= ea here is that you might want vnstat to do something even when the stick i= s (accidentally) removed.

best
=A0 =A0 =A0 =A0 Sebastian


>
> --Justin Madru
> _______________________________________________
> Cerowrt-devel mailing list
> Cerowrt-devel@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cerowrt-devel



_______________________________________________
Cerowrt-devel mailing list
Cerowrt-devel@lists.= bufferbloat.net
https://lists.bufferbloat.net/listinfo/cerowrt-devel




--
Dave T= =E4ht

Fixing bufferbloat with cerowrt: http://www.teklibre.com/cer= owrt/subscribe.html=20
--e89a8f235a17c03b0104d415d097--