How to measure network speed between two machines

The network speed is really important performance parameter when it comes to microservice architecture, because most of the services running on separate machines even on separate networks. If you measure the performance, you have to be sure that the network link between services are fast enough.

I made a short research about the tools to measure network speed and found that there is a really cool and simple command line tool called iperf. It is cross platform and completely open source with BSD licence. So you can download it from its official website or install directly with your package manager (if you are using unix based or mac operating system). On MacOS i installed it with homebrew.

sudo brew install iperf

After installing iperf on both ends we can start to measuring.

On first machine you have to start iperf as server, so that it listens incoming transfer requests:

iperf -s

On the other machine we can start iperf as a client and put the ip address of server machine as argument

iperf -c 192.168.1.6

The measurement takes only few seconds and then you can see the results on both machine.

------------------------------------------------------------
Client connecting to 192.168.1.6, TCP port 5001
TCP window size: 129 KByte (default)
------------------------------------------------------------
[ 4] local 192.168.1.66 port 62284 connected with 192.168.1.6 port 5001
[ ID] Interval      Transfer     Bandwidth
[ 4]  0.0-10.0 sec  1.09 GBytes  938 Mbits/sec

 

2 Comments

  1. f Reply

    So, thinking about our microservice infrastructure, how can we use iperf our total traffic through the whole topology on runtime for performance testing, profiling etc?

    • Selim Ok Reply

      Actually iperf is not intended to use as a monitoring or profiling tool, its rather a measuring tool to detect maximum available bandwidth between two network interfaces.

      If you want to monitor realtime network traffic, tools like ntopng are more appropriate for this purpose. See http://www.ntop.org/products/traffic-analysis/ntop/

Leave a reply