Flipkart

Wednesday 8 February 2017

How to use IPERF to test interface/network throughput in Linux

SCEANARIO: I have installed a new NIC or set up a new network connection and wanted to test if the speed is up to the standard using Iperf command.

Process:

You must be a root user for this exercise.

Once the interface you wanted to test is ready on Server A from Server B,

1. Make Server A as a listening server using the command below:

#iperf -S OR #iperf3 -S

Output would be like below :

-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------


2. Suppose say the IP of the interface you wanted to test is 192.168.1.25 which is assigned to eth0 on Server A, use the below command from Server B to test the speed of that interface.

#iperf3 -c 192.168.1.25 -i 2 -t 10

You see the output something like below:

Connecting to host 192.168.1.25, port 5201
[  5] local 192.168.1.5 port 44968 connected to 192.168.1.25 port 5201
[ ID] Interval       Transfer     Bandwidth
[  5] 0.00-2.00 sec  2.21 GBytes  9.48 Gbits/sec
[ ID] Interval       Transfer     Bandwidth
[  5] 2.00-4.00 sec  2.30 GBytes  9.86 Gbits/sec
[ ID] Interval       Transfer     Bandwidth
[  5] 4.00-6.00 sec  2.29 GBytes  9.83 Gbits/sec
[ ID] Interval       Transfer     Bandwidth
[  5] 6.00-8.00 sec  2.25 GBytes  9.67 Gbits/sec
[ ID] Interval       Transfer     Bandwidth
      Sent
[  5] 0.00-10.00 sec  11.3 GBytes  9.74 Gbits/sec
      Received
[  5] 0.00-10.00 sec  11.3 GBytes  9.74 Gbits/sec
iperf Done.

This output shows a 10Gig connection works fine as expected with good results.

Things to notice in the above output is:

1. See the bandwidth column which must be very close to your connections speed stats.
2. See the interval, I used every 2 Seconds in my command, that can be changed too.

What if, the expected speed is NOT observed on your network connection? Refer my other link below for network troubleshooting:

http://linuxunixdatabase.blogspot.in/2017/02/linuxunix-network-troubleshooting.html#!/2017/02/linuxunix-network-troubleshooting.html

OR

click below:

LUNIX UNIX NETWOTK TROUBLESHOOTING

Iperf is very handy command to check the connection throughput on Unix servers.

Refer Man page for more options after you get some basic idea on iperf usage

HAPPY LEARNING :)
Feel free to ask any questions or start a discussion about this topic.

My other Posts are below:

File System State is clean with errors in Linux:
http://linuxunixdatabase.blogspot.com/2017/02/file-system-state-is-clean-with-errors.html

How to use IPERF to test interface/network throughput in Linux:
http://linuxunixdatabase.blogspot.com/2017/02/how-to-use-iperf-to-test.html

Linux/Unix Network Troubleshooting:
http://linuxunixdatabase.blogspot.com/2017/02/linuxunix-network-troubleshooting.html

Removing existing LVM from your Linux System
http://linuxunixdatabase.blogspot.com/2017/02/removing-existing-lvm-from-your-linux.html

Learning AWK and SED Tools for LINUX/UNIX
http://linuxunixdatabase.blogspot.com/2017/02/learning-awk-and-sed-tools-for-linuxunix.html

No comments:

Post a Comment