How to Test Read and Write Performance on Debian Linux

In this post I will show you multiple ways to test read and write performance on your Debian installation. To get accurate results we will go through multiple tests and take some averages.

First things first, lets update our Debian apt package.

Shell

hdparm

Our first test is with my favorite hard drive performance utility, hdparm. Hdparm is a standard package available in just about every single Linux distro.

Shell

The following command will actually read the performance from our first partition, which coincidentally resides on our first hard drive.

Shell

Running a second test the results are similar, but slightly faster.

Shell

The reason we run the test multiple times is to rule out any memory caching to spoil or result accuracy. If you are on a virtual machine there is always a possibility of your first results being skewed.

DD

Our second program comes with every Linux distro I have ever installed. DD lets you take most inputs like random, null, zero and output them to a file. This is extremely fast and as a bonus you can easily control your block size. Since we are outputting data to a hard disk, DD lets us record the amount of time it takes to read or write and give performance results.

First we test write speed. The first test is to clear out the cache buffer.

Shell

The second test is the more accurate result.

Shell

Now let us test the read speed, which is normally much faster. We can take our previous tempfile and use it as input. First things first, lets clear the cache buffer.

Shell

With the cache buffer cleared we should now get a clear picture of our real read speed.

Shell

With this VM that is a pretty accurate read speed.

Be sure to clean up your tempfile by deleting it!

Shell
Continue Reading