vergoh / vnstat

vnStat - a network traffic monitor for Linux and BSD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Traffic rate for * higher than set maximum

bartgrefte opened this issue · comments

This problem has been reported before, see for example #81 but it still exists.

Got vnstat running on Debian 10 (setup as a router) with multiple vlan's, vnstat seems to be complaining about one in particular.

After Googling, I did what was mentioned at #81 (comment) , add the interface (I added all vlan interfaces) to the config file followed by a restart of vnstat and now it says this:

`Started vnStat network traffic monitor.
Info: vnStat daemon 1.18 started. (pid:3219 uid:110 gid:114)

Info: Monitoring: wifiguest50 (10 Mbit) he-ipv6 (1000 Mbit) wifi25 (10 Mbit) lan1 (10 Mbit) iot100 (10 Mbit) wan34 (1000 Mbit)

Info: Traffic rate for "lan1" higher than set maximum 10 Mbit (0->0, r0 t1), syncing.

Info: Traffic rate for "wan34" higher than set maximum 1000 Mbit (0->0, r1 t0), syncing.`

So even though I set them all to 1000Mb, it's still reporting several as 10Mb and one even with a higher rate than 1000Mb which is strange since 1000Mb is the maximum, of the physical interface that is.

So... what's going on?

vnStat 2.9 is currently the latest version and the version 1.18 you are using is rather old compared to it in many ways.

Could you provide the output of vnstat -D? That should show the current configuration and how it's being interpreted.

Those "higher than set maximum" (info level) warnings having "0->0" suggest that possibly vnstat -u has been used or there may also be something wrong with how that updates are being handled. However, let's start by checking that configuration first and also consider upgrading to a more recent version.

I guess that's a downside of Debian's extensive testing period, outdated software.

vnstat -D.txt

Updating to a more recent version requires going from Debian 10 to 11, not gonna do that just yet.

Oh and I noticed ethtool is reporting strange bandwidths:
lan1, wifi25, wifiguest50 and iot100: 10Mbps
wan34: 1000Mbps
he-ipv6 is down at the moment, stopped working couple of days ago, so can't check that one.

I am guessing there's no auto-negotiation going on since they are all virtual interfaces.

You'll have to disable BandwidthDetection if you want to continue with version 1.18. There's a bug/feature that was fixed/changed in version 2.8 that causes the interface reported bandwidth to be used even if interface specific MaxBW has been set in the configuration file. See issue #201 for some additional details as this was detected and changed as part of that report. See also https://humdi.net/vnstat/CHANGES for the changelist between the versions.

As for getting the latest version running even in Debian 10, the following instructions can be followed for compiling and installing the latest version: https://humdi.net/wiki/vnstat/install/in_debian

"You'll have to disable BandwidthDetection"
Just did that, followed by a restart of vnstat. It now says
"vnstatd[6202]: Info: Monitoring: wifiguest50 (1000 Mbit) he-ipv6 (1000 Mbit) wifi25 (1000 Mbit) lan1 (1000 Mbit) iot100 (1000 Mbit) wan34 (1000 Mbit)"
Is that expected output, 1000Mbit everywhere?

"if you want to continue with version 1.18"
Well, updating to Debian 11 won't help much, the version in that seems to be 2.6-3, so unless the fix for this particular issue has been backported...

"There's a bug/feature that was fixed/changed in version 2.8 that causes the interface reported bandwidth to be used even if interface specific MaxBW has been set in the configuration file. See issue #201 for some additional details as this was detected and changed as part of that report."
Noted :) , now after having checked #201 I'm wondering if the amount of data recorded by vnstat is correct.

Other counters I could find are "cat /proc/net/dev" and "ip -s link"
Both currently show 211228882845 bytes received and 185517132847 bytes send on the wan interface, without any timeframe mentioned, while vnstat says total rx 5.55TiB and tx 4.48TiB. and this month (so far) about 185GB and 160GB.

Any thoughts?

"As for getting the latest version running even in Debian 10, the following instructions can be followed for compiling and installing the latest version: https://humdi.net/wiki/vnstat/install/in_debian"
Noted, can I do that while the apt-version is installed and running?

"You'll have to disable BandwidthDetection"
Just did that, followed by a restart of vnstat. It now says
"vnstatd[6202]: Info: Monitoring: wifiguest50 (1000 Mbit) he-ipv6 (1000 Mbit) wifi25 (1000 Mbit) lan1 (1000 Mbit) iot100 (1000 Mbit) wan34 (1000 Mbit)"
Is that expected output, 1000Mbit everywhere?

Depends what you have configured in /etc/vnstat.conf for the interfaces. That wasn't visible from the earlier output you attached.

Noted :) , now after having checked #201 I'm wondering if the amount of data recorded by vnstat is correct.

It's not likely to be if the detected maximum bandwidth for the interfaces was much lower than the actualy maximum and you were often using close to the limit. In such cases, vnStat would ignore values resulting in higher throughput that what was configured/detected as invalid readings.

Both currently show 211228882845 bytes received and 185517132847 bytes send on the wan interface, without any timeframe mentioned

The timeframe is since the last system reboot or interface state reset.

"As for getting the latest version running even in Debian 10, the following instructions can be followed for compiling and installing the latest version: https://humdi.net/wiki/vnstat/install/in_debian"
Noted, can I do that while the apt-version is installed and running?

Yes. The new version will automatically import data from the old database format to the new format once you restart the service. However, you'll most likely want to also execute apt-mark hold vnstat to block any Debian provided upgrades since those would result in a downgrade in reality. The old database aren't discarded during the upgrade so you can still go be to the Debian provided version just by reinstalling the Debian package (if you'd for some reason want to do that).

"Depends what you have configured in /etc/vnstat.conf for the interfaces. That wasn't visible from the earlier output you attached."
Nothing interface specific, except that the default interface was never changed (still set to eth0 which does not exist), maybe this is what you are looking for?: "MaxBandwidth 1000" I have a hunch that this setting might be the reason.

"The timeframe is since the last system reboot or interface state reset."
The last reboot was quite some time ago:

uptime
 18:58:42 up 614 days,  7:20,  1 user,  load average: 0.00, 0.00, 0.00

(*looks at diy'd 19V DC UPS ) but interface state reset was at the time of my previous message a month or so ago after I temporarily disabled the primary circuit breaker which cut power to the entire house, which meant the switch and fiber modem went down but the router-pc kept running.

"Yes. The new version will ....."
Okay :)

Oh and after checking journalctl, the last "traffic state ....." message was almost a month ago so the log is not flooded anymore :)