Testing network throughput with iperf

kleegeek, 2013-11-20 (first published: 2013-11-11)

networkcable

Have you ever wondered if that black box in your datacenter called the network is performing as well as it should be? Do you have random periods of time where normally fast processes seem to take forever, but the diagnostics on your servers all seem fine? What about validating the network performance back and forth to your disaster recovery site? Let’s go through how to check the network to make sure that all is well, or generate some objective repeatable tests that you can bring to your networking group and ask questions with.

In my SQL PASS Summit presentation from last month, I mentioned a free utility that I use called iperf that you can use to validate your network performance. Several questions came up about where to get it and how to use it. Read on for a walk-through of how to use iperf!

You can validate network performance with a free utility called iperf, and here is a full walk-through of how to use the utility. 

Iperf is available for free on most Linux distributions. I generally use a pair of Ubuntu Server-based virtual machines to perform my testing. A simple sudo apt-get install iperf command installs it. I can move the virtual machines to different physical servers, jump around on different VLANs, or because they are so small, move them to the DR locations to spot-check network performance.

You can also download a compiled version of iperf for Windows for free at linhost.info. Just download it into a folder of your choosing or place it somewhere in the system path so you can execute it from anywhere.

Using the tool is very straightforward. You need two copies of the utility on two different servers. From a command prompt, start up the server node by typing the following command.

iperf -s

That’s it! You just started up the server. We will refer to this as the target server.

On the second server, we will kick of a simple test from this server to the target server. We will call this server the source server. Enter the following command in a command prompt on the source server.

iperf -c (ip address or name of target server) -t 10

This command just kicked off a ten second test with maximum throughput testing to the source server.

Of course, you can get more sophisticated with your testing at this point, but I keep it simple for most cases unless something unusual pops up.

The results look something like this.

iperf Server - Different Host

iperf Server – Different Host

iperf Client - Different Host

iperf Client – Different Host

Sweet. 943 Mb per second is almost perfect on a gigabit network. Looks like my home lab is working properly  🙂

Now, if these are virtual machines, you can sometimes trigger internal network routing on the physical machine so that it never actually leaves the host. Check out these results!

iperf02

iperf Server – Same VM Host

iperf01

iperf Client – Same VM Host

Done! Isn’t that amazing? It’s a great performance optimization trick to pair VMs together that have high data transfer rate relationships. Both VMware vSphere and Microsoft Hyper-V have methods to pair VMs together on the same host. You can dramatically boost the performance of your large batch processing or data movements every day by doing this! (Just do not pair two nodes of an HA pair of application components, such as Availability Groups. You create a single point of failure by doing so!)

Please remember to test two-way communications by flipping the roles of the utilities. Occasionally, one-way communication problems can pop up!

Enjoy one of my favorite utilities, and validate your environments today!

Rate

Share

Share

Rate

Related content

Database Mirroring FAQ: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup?

Question: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? This question was sent to me via email. My reply follows. Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? Databases to be mirrored are currently running on 2005 SQL instances but will be upgraded to 2008 SQL in the near future.

Robert Davis

2009-02-23

1,567 reads

Networking – Part 4

You may want to read Part 1 , Part 2 , and Part 3 before continuing. This time around I’d like to talk about social networking. We’ll start with social networking. Facebook, MySpace, and Twitter are all good examples of using technology to let…

Andy Warren

2009-02-17

1,530 reads

Speaking at Community Events – More Thoughts

Last week I posted Speaking at Community Events – Time to Raise the Bar?, a first cut at talking about to what degree we should require experience for speakers at events like SQLSaturday as well as when it might be appropriate to add additional focus/limitations on the presentations that are accepted. I’ve got a few more thoughts on the topic this week, and I look forward to your comments.

Andy Warren

2009-02-13

360 reads