LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bandwidth usage (https://www.linuxquestions.org/questions/linux-newbie-8/bandwidth-usage-698198/)

masenko703 01-18-2009 06:34 PM

Bandwidth usage
 
Hi all,
This might sound like a noob question but I was wondering what is the command to monitoring bandwidth usage? I have this is server at work that keeps going down every week but its b/c they saturate their bandwidth. What other command can I run to monitor server resources. thanks.

alan_ri 01-18-2009 09:52 PM

Maybe
Code:

# iptables -L -v
will do.
Or maybe you'd like vnStat better.

masenko703 01-18-2009 10:18 PM

Thanks for the reply but one more question. I ran the following command like you suggested on my CentOS VM server and i received the following results:

# iptables -L -v

Chain INPUT (policy ACCEPT 214 packets, 13643 bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 231 packets, 16217 bytes)
pkts bytes target prot opt in out source destination


Could you please break it down and explain the above? Thanks again.

your_shadow03 01-18-2009 10:29 PM

Try out
Code:

iperf
iperf is a tool to measure maximum TCP bandwidth, allowing the tuning of various parameters and UDP characteristics.

your_shadow03 01-18-2009 10:30 PM

Install iperf

If you are using Debian / Ubuntu Linux, enter:
$ sudo apt-get install iperf
If you are using FreeBSD, enter:
# cd /usr/ports/benchmarks/iperf
# make install clean
Source code installation for RHEL / CentOS:
# gunzip -c iperf-.tar.gz | tar -xvf -
# cd iperf-
# make; make install
Start iperf on server

To start iperf on server, type the following command:
freebsdbox # /usr/local/bin/iperf -s
Output:

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 64.0 KByte (default)
------------------------------------------------------------

Test iperf from client

Let us connect to our freebsdbox, enter:
$ iperf -c freebsdbox
Output (note my freebsdbox is on slow vsat link):

------------------------------------------------------------
Client connecting to freebsdbox, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.106 port 40256 connected with 71.zzz.xxx.yyy port 5001
[ 3] 0.0-10.7 sec 624 KBytes 480 Kbits/sec

The last line (the red numbers) specifies the speed.
Use UDP rather than TCP

The -u option force to use UDP. The following example run udp test and bandwidth to send at in bits/sec is specified using the -b option:
$ iperf -c rhelbox -u -l 512 -b 10m


All times are GMT -5. The time now is 09:09 AM.