4

I am wondering if there is a way to measure bandwidth by a tcp/udp port under Linux?

Means I search for a way to be able to tell, tcp/53 needs now 1MBit/s, tcp/80 needs now 4.5MBit/s. iperf is able to tell me this details, but my issue is I need it in shell/bash to extract the data for later use.

cilap
  • 277
  • 5
  • 14

2 Answers2

2

i would recommend darkstat, a description on how to is available here

Corleone
  • 121
  • 6
  • Hello Corleone, thank you for darkstat, did not know about it before. I cannot find a option how to trace my specific ports to stdin or to a file for later parsing? Do you know how to handle it? – cilap Oct 02 '15 at 09:10
  • retrying: Corleone, can you help me on my query? – cilap Oct 06 '15 at 11:57
  • @cilap Nope!! Sry missed your comment, came to know the features of **darkstat**, and suggested _post googling_ – Corleone Oct 06 '15 at 18:13
1

Just for completeness, the best and easiest way to monitor bandwidth per port or bunch of ports under Linux, is to use tc to setup QoS.

You can use FireQoS - a high level tool for configuring QoS - and netdata for monitoring it in real-time.

Check this for more information: https://github.com/firehol/netdata/wiki/You-should-install-QoS-on-all-your-servers

cilap
  • 277
  • 5
  • 14
  • This looks very interesting. I already use `tc` a lot at home and at my VPS provider. It will be interesting to see what kind of rules they effectively generate. – Aaron May 26 '17 at 12:00