Easy Linux or UNIX Network Load Testing

Posted on in Categories Linux, Networking, Sys admin, Tips, Troubleshooting, UNIX last updated January 3, 2007

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 [email protected]:/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.

9 comment

  1. 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. 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.

  3. 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.

  4. 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.

  5. 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.

Leave a Comment