Network throughput

How to start with Linux

Testing your network speeds.

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

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.

$ dd if=/dev/zero of=/mnt/cifs/net.img bs10M count1000

3219128320 bytes 3,2 GB, 3,0 GiB copied, 37,2356 s, 86,5 MB/s
1000+0 records 
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 blackhole  

$  -l 777  /dev/null

Now we need to send data to pc1 from pc2

// From pc2 - pc1

$  true   if/dev/zero bs1024k   pc1 777  

Now run a network monitor, i used speedometer, and you can see what your average througput is