How to count internet traffic

Hi, i got 3G-router based on open-wrt and i looking for advice: how to count my 3g traffic on this device. There are a few applications inside, and this apps consumes a lot of traffic, i want to reduce it. And here I want to understand which application is spending the most. Ntop and tcpdump I used only show the total consumption, its not enough for troubleshooting. Thank you for help.

What applications are you talking about? Are they on the router?

Yep. zabbix agent for example and a few self created apps with python. Its running constantly on the router

Well I am not sure if it will help but collectd and rrdtool are your best bet with this. You need to install luci-app-statistics for this functionality and then you can configure it as you like. It includes various packages for different types of stats. You may also wanna try the documentation first and familiarize yourself with it.
https://openwrt.org/docs/guide-user/luci/luci_app_statistics

nethogs (isn't ported to my knowledge) and/or iftop?

You may look into this. If iftop is available you can use it for real time stats.

Yes, i'm trying to use iftop, but it shows only total consumption, i need to know how much traffic spent with every PID on device.

I already provided you with information above in post #4.

I personally use softflowd and snmpd. I don't have anything looking at individual processes, though.

Also, this data is processed by another server.

@engs
atop shows per process if you install kernel module (netatop)

It's available as a package

1 Like