Skip to Content

How to test NFS performance with dd on Linux?

NFS performance is important for the production environment. In this tutorial, we will review how to use DD command to test local storage and NFS storage performance.

Test nfs storage performance on Linux

There are some differences between each testing command. We choose dd command in the following example.

  • dd – without conv=fsync or oflag=direct. This uses filesystem cache.
  • scp – This is bottlenecked by a single CPU core performing encryption, and eventually by OpenSSH’s built-in 64KiB buffer size.
  • rsync – This uses filesystem cache, and cannot bypass the cache.

Note: These tests examples will drop filesystem cache. Please use them carefully.

Test write performance of the local storage with dd command

Drop cache before every test.
echo 3 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=/tmp/testfile.bin bs=1M count=10000 conv=fsync

Test read performance of the local storage with dd command

Drop cache before every test.
echo 3 > /proc/sys/vm/drop_caches
dd if=/tmp/testfile.bin of=/dev/null bs=1M

Test streaming write performance of the NFS client with dd command

Drop cache before every test
echo 3 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=/mnt/nfs/testfile.bin bs=1M count=10000 conv=fsync

Test streaming read performance of NFS client with dd command

Drop cache before every test
echo 3 > /proc/sys/vm/drop_caches
dd if=/mnt/nfs/testfile.bin of=/dev/null bs=1M

Related Post:

6 Underrated Linux Commands That Deserve More Attention - howtouselinux

Wednesday 25th of October 2023

[…] Interestingly, “dd” stands for “converting and copying” files, but it couldn’t be named “cc” due to the already existing C compiler. Check more about how to use dd command to test storage performance […]