Testing Network Throughput

Find your way to the Linux operating system

There are several ways to test your network throughput in Linux.
I will show you a view ways to do this.

1: You can mount a (e.g. cifs) share locally and run dd on it.
Let’s say I’ve mounted a share under /mnt/cifs, and I’m going to test a 10G file.\// Start dd (dd = well nice discussions @google)

$ dd if=/dev/zero of=/mnt/cifs/net.img bs=10M count=1000

Result will look like:

3219128320 bytes (3,2 GB, 3,0 GiB) copied, 37,2356 s, 86,5 MB/s 
1000+0 records in 
1000+0 records out 
10485760000 bytes (10 GB, 9,8 GiB) copied, 946,567 s, 11,1 MB/s

As you can see, my (old) nas is not that fast anymore :), but still get’s the job done.

2: You can also test the throughput with netcat (nc). First we need to start nc on, let’s say pc 1:

// Listen on port 777 and redirect to /dev/null // (our black hole ;) ) 
$ nc -l 777 > /dev/null

Now we need to send data to pc1 from pc2

// From pc2 -> pc1 
$ while (true); do dd if=/dev/zero bs=1024k | nc pc1 777 ; done

Start a network monitor, i used speedometer, and you can see what your average throughput is: