How to perform network Bandwidth tests between EC2 Linux Instances

So, a lot of people in IT love to benchmark stuff, and I can see why. What better way to know if someone can promise what they deliver then by actually seeing the results for yourself?

In that regard, I was curious to find out what the network speeds were between EC2 instances that were in the same AZ/region in the same VPC. AWS advertises speeds up to 10 gigabit for their highest instances, and I wanted to see if I could achieve these speeds myself.

Because I love linux servers and can’t stand windows servers (open source ftw), I decided to launch 2 EC2 Amazon Linux nodes. These instances were both in the same region (us-west-2 oregon) and same AZ. I also launched them in the same VPC/subnet so that they would be as close together as possible with minimal hops in between them.

I decided to use iperf as this is a great network diagnostic tool (https://iperf.fr/). It was unavailable to download via yum :(, however its super easy to download if you just enter this command in your linux terminal after launching and connecting to your nodes:

$ wget https://iperf.fr/download/iperf_2.0.5/iperf_2.0.5-2_amd64 ; chmod +x iperf_2.0.5-2_amd64 ; sudo mv iperf_2.0.5-2_amd64 /usr/bin/iperf

Once installed on both instances, you then need to designate one instance as a server and one as a client (doesn’t matter what you decide just make a decision).

For the server instance, enter $ iperf -s
To enter into listening mode

For the client instance, enter $ iperf -c 10.0.0.3 -t 5 (where 10.0.0.3 is the private IP of your server instance, 5 is specifying 5 seconds of time for testing)

From here you should start getting read outs showing the true network speed between your instances. Neat!

Caveats-
*I found it easiest to just allow all traffic within the VPC/security group so that the testing could occur without issue as far as traffic being blocked
*For the fastest speed, you have to use the largest instances and also make sure enhanced networking is enabled. I found enhanced networking is enabled on the latest Amazon Linux AMIs by default, so that was nice. However, if you want to check if your instances have enhanced networking enabled check this guide: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html
*What I have is a very particular set of skills; skills I have acquired over a very long career. Skills that make me a nightmare for people like you. I can create websites in a relatively short amount of time.

One thought on “How to perform network Bandwidth tests between EC2 Linux Instances

  1. Wired connections do not have this problem, of course. Still, the information you receive from LAN Speed Test will put you in a much better position to gauge how well your home network can handle file transfers between computers on the network.

Leave a Reply

Your email address will not be published. Required fields are marked *