What is chewing up my bandwidth?
Occasionally my laptop appears to chew bandwidth for no reason. Getting to the bottom of that can be tricky. Here are some useful programs to do that.
# nethogs
will tell you what program is the bandwidth hog e.g. skype but it won’t tell you specifically where it is coming from or what process is involved. To find out more, try:
# lsof -i tcp -sTCP:ESTABLISHED
# pktstat -t -i wlan0
# iptraf
# iftop -p -i wlan0 -P
# netstat -tunp or -tup
None of them are overwhelmingly intuitive and I am still working out which one works best for me. Obviously substitute your port for wlan0 in the abovfe.
Follow-up:
Of the above I have found that
# iftop -p -i wlan0 -P
works the best for me. Sometimes you want to know which app is chewing up your bandwidth but often enough these days it is one of the many open browser pages you have so pointing to chrome or firefox is not that helpful. iftop identifies the site where the bandwidth usage is coming from. That seems to work best for me.