Current Date: Sun, Apr 11, 2021 3:38 AM

How to Stress Test the Hard Drive on Your Computer or Server?

Do you want to know which of your hard drives is the fastest and is it really as fast as the manufacturers promise? Whether on a PC or a Server, the free Diskspd utility will Stress Test and benchmark your hard drives.

How to Stress Test the Hard Drive on Your Computer or Server?

Note:

Stress Test is a way to test reliability.

In the past, users used to use old Microsoft SQLIO utility to Stress Test. However, Microsoft currently only provides Diskspd utility that replaces SQLIO.

1. Why use Diskspd?

Diskspd will tell you the maximum capacity your hard drive can handle or the fastest point on the hard drive you should use for purposes like gaming, ... on your computer.

You can refer to the example below, assuming there are 3 drives per server: drive F, drive G and drive C. If drive F has MDF, drive G has LDF and the operating system is on drive, we have can evaluate which setting is effective.

How to Stress Test the Hard Drive on Your Computer or Server?

How to Stress Test the Hard Drive on Your Computer or Server?

How to Stress Test the Hard Drive on Your Computer or Server?

If using Diskspd for analysis, drive F will be the fastest drive, so we will "insert" the MDF file into drive F.

2. Download Diskspd

Microsoft provides the Diskspd tool for free, and you can download it from Microsoft Technet. Also Diskspd is open source so you can download and test or edit the source code from GitHub.

Download Diskspd and install it here.

Diskspd works on Windows versions 7,8,8.1 and 10 as well as on Windows Server 2012, 2012 R2 and 2016 Technical Preview 5.

Once downloaded, you proceed to extract the .zip file into a folder. Note that the extracted folder contains 3 different "diskapd.exe" files. One is "amd64fre" for 64-bit Windows, and the "x86fre" folder is for 32-bit Windows.

How to Stress Test the Hard Drive on Your Computer or Server?

3. How to do the Stress Test?

To perform the test, you can simply call the Diskspd command from an Admin-enabled Command Prompt.

On Windows 10 or 8.1, right click the button Start in the bottom left corner then selectCommand Prompt (Admin).

On Windows 7, find the shortcut Command Prompt on the Start menu, then select Run as administrator.

First, use cd to convert the directory containing the Diskspd.exe you want to use:

cd c: \ path \ to \ diskspd \ amd64fre

How to Stress Test the Hard Drive on Your Computer or Server?

Next, run the Diskspd command that contains the options you want to use. You will find a list of command options and usage information in the 30-page DiskSpd_Documentation.pdf file attached to the Diskspd you downloaded.

However, if you want to run the command quickly, here's an example:

The following command sets block size 16K (-b16K), runs the test for 30 seconds (-d30), disables hardware and software (-Sh), latency statistics measures (-L) , using two IO requests per thread (- o2) and four threads (-t4) per target, using random access rather than sequential write (r), performing 30% write operations and 70 % read operations (-w30).

It will create a file at c: \ testfile.dat 50 MB in size (-c50M). If you want to benchmark the D: drive instead, specify d: \ testfile.dat

Diskspd.exe -b16K -d90 -Sh -L -o2 -t4 -r -w30 -c50M c: \ testfile.dat

How to Stress Test the Hard Drive on Your Computer or Server?

After 30 seconds, the test results of the above command will appear on the Command Prompt and you can see the results there.

When looking up the results you will see the average MB / s the drive achieved during the test - how many write operations were performed per second, how many read operations were performed per second, and the total Input / Output (IO) operations are performed every second.

How to Stress Test the Hard Drive on Your Computer or Server?

These statistics are extremely useful in the case when comparing multiple drives to gauge which one is faster for specific operations, and it also gives you an exact indication of how much IO per one. the hard drive can handle it.

Also you can export the results to a text file for later viewing. For example, run the following command with the above command and the result is displayed in the file C: \ testresults.txt.

Diskspd.exe -b16K -d90 -Sh -L -o2 -t4 -r -w30 -c50M c: \ testfile.dat> c: \ testresults.txt

How to Stress Test the Hard Drive on Your Computer or Server?

Do the same with other drives and compare.

4. Customize the Stress Test command

If you're trying to figure out which hard drive is the fastest to do heavy duty jobs, you should create a command that is best suited for the workload. For example, if a server only reads data and doesn't write, you should do a 100% read test and not do any write performance tests. Run the Stress Test on multiple drives and compare the results to see which is faster and right for the job you need to perform.

Note that there are many different command line options you can specify for Diskspd.exe. Here are some important options:

  • -w represents the percentage of writing and reading activity. For example, typing -w40 will do 40% of all writing and 60% of all read operations. Input -w100 will perform 100% of the writing operation. Ignoring -w or entering -w0 will perform 0% of write operations and 100% of read operations.
  • -r or -s determines usage testing or random access or sequential operations. Specify -r for random access or -s for sequence. This helps you check for either random file access (usually a bunch of small files) or sequential file access (usually one large file read or write all at once).
  • -t denotes number of threads that will be run at the same time, such as -t2 for 2 threads or -t6 for 6 threads.
  • -o denotes number of outstanding requests per thread, such as -o4 for 4 requests or -o2 for 2 results.
  • -d is the duration of the tests in seconds, such as -d90 for 90 seconds or -d120 for 120 seconds.
  • -b is the block size of activities like read or write, such as -b16K for block size 16K or -b64K for block size 64K.

Refer to some more articles below:

  • How to check and detect RAM and hardware problems on your Windows PC?
  • Everything about laptop RAM and everything you need to know
  • Summary of tips to fix Windows 10/8 / 8.1 / 7 and Windows XP running slow

Good luck!