Easy Linux or UNIX Network Load Testing

by on January 3, 2007 · 9 comments· LAST UPDATED January 3, 2007

in , ,

You can easily test out Linux/UNIX network Load using standard dd and scp commands.

=> Use dd to create a large file.

=> Use scp to copy file from one system to another system. scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Make sure both local and remote system owned by you i.e. co-operation from another host on the network is required for test network load.

Step # 1: Create a large file

Use dd command as follows to create a large file (e.g. 1024M x 2count = 2GB):
$ dd if=/dev/zero of=/tmp/big.file bs=1024M count=50

Step # 2: Use scp to transfer file

Now copy a file to remote host using scp:
$ scp /tmp/big.file user@remote.server.com:/tmp

Any error or crash indicates problem with system load testing.

Please note that if the server has two+ network cards, make sure that the test is run and uses each of the network cards. Disable NIC using ifconfig command or alter routing using route command for testing purpose.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!
1 kotnik January 6, 2007 at 6:49 am

I sometimes use ping -f (reqest sent is a dot, answer recieved is a backspace) for testing. It tells a little about network, but I like fast drawing in terminal :)

2 nixCraft January 6, 2007 at 7:25 am

Yup, it will not give any idea about network load testing but you get all dots (visuals). I guess that gives some sort of satisfaction.. LOL

3 mb January 8, 2007 at 2:43 pm

It is a bad idea in my opinion to test the load on a network by adding a large amount of traffic on the network. Particularly on a WAN, if you didn’t have a network bottleneck before the test, you certainly will during the test! Always be aware of what kind of bandwidth you have to the destination. Throw this kind of traffic on a slow international link and watch business traffic performance die during the copy. Lastly, on a network that has QOS, you will only get the performance of the network as it is tuned for the SCP traffic which may not be a true representation of network load.

4 mike January 10, 2007 at 7:21 pm

If you run this on older hardware, your as likely to run into CPU or disk bottlenecks as a network bottleneck. Using the technique described, you are encrypting all of your traffic on one end and decrypting on the other end, eating up CPU cycles on both machines. You are also relying on disk I/O to read the data on the sending side and write on the receiving side. Try using ‘TTCP’ instead. No encryption is necessary, nor is I/O to the disk subsystem. Use TTCP with caution, however. This tool can fill up a network pipe easily–especially in UDP mode, which blasts as much traffic as it can generate.

5 nixCraft January 10, 2007 at 7:42 pm

mb and mike,

I am aware of problem you have stated here. However in this example box was connected to 1000Mbps port and I needed to test this entire load testing for production.

Appreciate your posts/suggestions.

6 kofi adumatta March 16, 2007 at 1:44 pm

pls i will like to get note on linux and unix networking .

7 mendem November 15, 2008 at 4:06 pm

phewww… use lmbench

8 sean November 23, 2008 at 8:14 pm

Load testing the network with SCP is only valid on a LAN <1ms latency and if disk I/O is actually capable or greater than the network throughput which is nearly never the case.

If you are testing network links that are greater than 1ms, or where the bandwidth delay product is greater than 4K SCP also fails becuase it moves data in 4 K blocks, so the transmit pathway will be idle waiting on acknowledges.

9 Mark April 23, 2010 at 8:44 pm

Why not use iPerf? That’s what it’s designed for, and it gives a ton more info than copying large files!

Comments on this FAQ are closed. If you'd like to continue the discussion on this topic, you can do so at our forum.

Previous post:

Next post: