From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by huchra.bufferbloat.net (Postfix) with ESMTP id 1322021F15E for ; Thu, 24 Jan 2013 09:40:58 -0800 (PST) Received: from mailout-de.gmx.net ([10.1.76.30]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MNO9n-1U4kSH0wg5-006yeZ for ; Thu, 24 Jan 2013 18:40:56 +0100 Received: (qmail invoked by alias); 24 Jan 2013 17:40:55 -0000 Received: from tsaolab-fw.caltech.edu (EHLO [192.168.50.1]) [131.215.9.89] by mail.gmx.net (mp030) with SMTP; 24 Jan 2013 18:40:55 +0100 X-Authenticated: #24211782 X-Provags-ID: V01U2FsdGVkX1/pNft4coHpOXgl689VZ/OEQPvsDoKgvEYjC1KPUV LCKccvJiBUwkz9 Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=windows-1252 From: Sebastian Moeller In-Reply-To: Date: Thu, 24 Jan 2013 09:40:47 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Justin Madru X-Mailer: Apple Mail (2.1283) X-Y-GMX-Trusted: 0 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: Thu, 24 Jan 2013 17:40:58 -0000 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, >=20 > I noticed that the TX/RX counter as reported by ifconfig and in the = web 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 = read out the value and compare to your last value to detect overruns = (assuming 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=20 > 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 = 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 = 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 = 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 = 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 =20 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 = 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 = 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 = stick is (accidentally) removed. best Sebastian >=20 > --Justin Madru > _______________________________________________ > Cerowrt-devel mailing list > Cerowrt-devel@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cerowrt-devel