How to Check Hard Drive Speed on a Windows VDS?
The performance of your hard disk drive (HDD) or solid-state drive (SSD) on your Windows Virtual dedicated servers (VDS) is crucial for the overall speed and responsiveness of your server. A slow drive can lead to delays in application, database, and website performance. In this article, we'll delve into various methods and tools to check the disk speed on your Windows VDS, allowing you to identify potential bottlenecks and take steps to address them.Table of Contents
- Checking Disk Speed with Diskspd
- Using PowerShell to Test Disk Performance
- Analyzing Disk Performance via Performance Monitor
- Testing Disk Speed with CrystalDiskMark
Checking Disk Speed with Diskspd
Diskspd is a powerful command-line utility developed by Microsoft for comprehensive disk performance testing. It allows you to conduct various tests, including sequential read and write, random read and write, and more. Diskspd is particularly useful for identifying specific performance issues and optimizing disk configuration. Example 1: Simple Sequential Write Test To get started, you need to download Diskspd from the Microsoft website (usually provided as part of the Windows Assessment and Deployment Kit (ADK)). After downloading, extract the archive to a convenient location, such as `C:\Diskspd`.C:\Diskspd\diskspd.exe -b4k -t1 -o1 -w100 -d30 -c100m C:\testfile.dat
Let's break down the command parameters:
- `-b4k`: Specifies a block size of 4KB.
- `-t1`: Specifies the number of threads as 1.
- `-o1`: Specifies the number of outstanding I/O operations as 1.
- `-w100`: Specifies that 100% of operations are writes.
- `-d30`: Specifies the test duration as 30 seconds.
- `-c100m`: Specifies the test file size as 100MB.
- `C:\testfile.dat`: Specifies the name of the file that will be used for testing. Ensure that the user under which you run the command has write permissions to the specified directory.
C:\Diskspd\diskspd.exe -b4k -t4 -o32 -r -w50 -d60 -c100m C:\testfile.dat
Parameters of this command:
- `-b4k`: Block size of 4KB.
- `-t4`: 4 threads.
- `-o32`: 32 outstanding I/O operations.
- `-r`: Performs random read and write operations.
- `-w50`: Write operation ratio of 50% (the remaining 50% is read).
- `-d60`: Test duration of 60 seconds.
- `-c100m`: Test file size of 100MB.
C:\Diskspd\diskspd.exe -b8k -t8 -o16 -r -w25 -d120 -c50m C:\testfile1.dat C:\testfile2.dat C:\testfile3.dat
This example uses 3 files (`C:\testfile1.dat`, `C:\testfile2.dat`, `C:\testfile3.dat`). Parameters:
- `-b8k`: Block size of 8KB.
- `-t8`: 8 threads.
- `-o16`: 16 outstanding I/O operations.
- `-r`: Random operations.
- `-w25`: 25% write operations.
- `-d120`: Test duration of 120 seconds.
- `-c50m`: Size of each test file is 50MB.
- Throughput (MB/s): Shows the data transfer rate in megabytes per second. The higher the value, the better the performance.
- IOPS (Operations Per Second): Shows the number of input/output operations performed per second. High IOPS indicates good performance when working with small files and random access.
- Latency (ms): Shows the average delay in performing input/output operations. Low latency is critical for applications that require fast response times.
Need Maximum Speed? Upgrade to NVMe!
If your VDS tests reveal a need for speed, our NVMe dedicated servers deliver outstanding performance for any workload. — from €28.99/mo.
Get NVMe Server →
rocket_launch
Quick pick
Need a dedicated server?
Compare prices from top providers. Configure and order in minutes.
Using PowerShell to Test Disk Performance
PowerShell provides convenient tools for monitoring and testing disk performance on a Windows VDS. Using built-in cmdlets, you can obtain information about read/write speeds, IOPS, and latencies, as well as create your own scripts to automate testing. Example 1: Getting Basic Disk InformationGet-WmiObject Win32_DiskDrive | Select-Object Model, InterfaceType, MediaType
This command retrieves information about disk models, interface type (SATA, SAS, NVMe), and media type (HDD, SSD). This is useful for determining the characteristics of the installed disks.
The expected output will be something like this:
Model InterfaceType MediaType
----- ------------- ---------
Msft Virtual Disk IDE Fixed hard disk media
In this example, you can see that a virtual disk (Msft Virtual Disk) with an IDE interface and "Fixed hard disk media" media type is used.
Example 2: Measuring Read and Write Speed with Test-Path
This method uses the `Test-Path` cmdlet to create, write, and read a small file, measuring the time spent on these operations.
$FilePath = "C:\testfile_powershell.dat"
$FileSize = 10MB
$Data = New-Object byte[] $FileSize
$Random = New-Object Random
$Random.NextBytes($Data)
# Write
$sw = [Diagnostics.Stopwatch]::StartNew()
[IO.File]::WriteAllBytes($FilePath, $Data)
$sw.Stop()
$WriteTime = $sw.ElapsedMilliseconds
$WriteSpeed = [Math]::Round(($FileSize / $WriteTime) * 100, 2)
# Read
$sw = [Diagnostics.Stopwatch]::StartNew()
$ReadData = [IO.File]::ReadAllBytes($FilePath)
$sw.Stop()
$ReadTime = $sw.ElapsedMilliseconds
$ReadSpeed = [Math]::Round(($FileSize / $ReadTime) * 100, 2)
Remove-Item $FilePath
Write-Host "Write speed: $($WriteSpeed) KB/s"
Write-Host "Read speed: $($ReadSpeed) KB/s"
This script creates a 10MB file, fills it with random data, writes it to disk, reads it back, measures the write and read times, calculates the speeds, and deletes the file. The results are output to the console.
Example 3: Using Performance Counters to Monitor IOPS and Latencies
PowerShell allows you to access performance counters that provide information about various aspects of the system, including the disk subsystem.
$Disk = Get-WmiObject Win32_PerfFormattedData_PerfDisk_PhysicalDisk | Where-Object {$_.Name -ne "_Total"}
foreach ($d in $Disk) {
Write-Host "Disk: $($d.Name)"
Write-Host " % Disk Time: $($d.PercentDiskTime)"
Write-Host " Avg. Disk sec/Read: $($d.AvgDisksecRead)"
Write-Host " Avg. Disk sec/Write: $($d.AvgDisksecWrite)"
Write-Host " Disk Reads/sec: $($d.DiskReadPerSec)"
Write-Host " Disk Writes/sec: $($d.DiskWritePerSec)"
}
This script retrieves data about physical disks, excluding the total object ("_Total"). For each disk, it outputs the percentage of time the disk is busy, the average time to read and write a sector, and the number of read and write operations per second (IOPS). Note that the values are snapshots in time. For more accurate data, you need to collect data over a period of time and calculate average values.
Interpreting PowerShell Results
- Read/Write Speed (KB/s): Higher values indicate faster data transfer. Low speed may indicate a problem with the disk or controller.
- % Disk Time: A high percentage (>80%) may indicate that the disk is a bottleneck in the system.
- Avg. Disk sec/Read and Avg. Disk sec/Write: Lower values indicate faster processing of I/O operations. Values above 0.01 seconds (10 ms) may indicate performance problems.
- Disk Reads/sec and Disk Writes/sec (IOPS): Higher values indicate a larger number of I/O operations that the disk can handle per second. Typical values for HDDs are 50-150 IOPS, for SSDs – thousands or tens of thousands of IOPS.
Analyzing Disk Performance via Performance Monitor
Windows Performance Monitor (Perfmon) is a graphical tool that allows you to track various aspects of system performance, including disk performance. It provides a wide range of counters that can be used to monitor read/write speeds, IOPS, latencies, and other parameters. Performance Monitor is particularly useful for visually analyzing disk performance in real-time and for identifying load-related issues. Example 1: Launching Performance Monitor and Adding Counters- Open Performance Monitor by typing `perfmon` in the Windows search bar and pressing Enter.
- In the left pane, expand "Monitoring Tools" and select "Performance Monitor".
- Click the "+" (Add) icon on the toolbar to add counters.
- In the "Add Counters" window, select the "PhysicalDisk" object (for physical disks) or "LogicalDisk" (for logical disks).
- Select the desired counters, for example:
- "% Disk Time": The percentage of time that the disk is busy processing requests.
- "Avg. Disk sec/Read": The average time it takes for the disk to read data (in seconds).
- "Avg. Disk sec/Write": The average time it takes for the disk to write data (in seconds).
- "Disk Reads/sec": The number of read operations performed by the disk per second (IOPS).
- "Disk Writes/sec": The number of write operations performed by the disk per second (IOPS).
- "Avg. Disk Queue Length": The average length of the disk request queue.
- Select a specific disk instance (for example, "0 C:" for disk C:) or "_Total" for summary statistics for all disks.
- Click "Add", then "OK".
- % Disk Time: If the graph is constantly at 80% or higher, it may indicate that the disk is overloaded and is a bottleneck.
- Avg. Disk sec/Read and Avg. Disk sec/Write: High values (above 0.01 seconds) indicate slow processing of I/O operations. Disk Reads/sec and Disk Writes/sec: Allow you to evaluate IOPS. Compare the obtained values with typical values for your disk type (HDD or SSD servers).
- Avg. Disk Queue Length: A long queue (>2) may indicate that the disk cannot keep up with requests.
- In the left pane of Performance Monitor, expand "Data Collector Sets" and select "User Defined".
- Right-click and select "New" -> "Data Collector Set".
- Enter a name for the DCS (for example, "DiskPerformance") and select "Create manually (Advanced)".
- Select "Create data logs" and check the "Performance counter" box.
- Click "Add" and add the desired counters (as described above).
- Specify the data collection interval (for example, 1 second).
- Specify the location to save log files.
- Start the DCS by right-clicking on its name and selecting "Start".
Testing Disk Speed with CrystalDiskMark
CrystalDiskMark is a popular free utility for testing the performance of hard drives and solid-state drives (SSDs) under Windows. It provides a simple and convenient interface for measuring sequential and random read/write speeds, as well as IOPS. CrystalDiskMark is often used to compare the performance of various drives and to assess the impact of various settings on performance. Example 1: Launching CrystalDiskMark and Selecting Test Parameters- Download CrystalDiskMark from the official website and install the program.
- Launch CrystalDiskMark.
- In the main window, select:
- Number of Runs: The number of test repetitions (usually 3-5).
- Test Size: The size of the file used for testing (for example, 1GiB).
- Drive: The disk you want to test.
- Seq Q32T1: Sequential read/write with a queue depth of 32 and 1 thread. Emulates the load when multiple requests are sent to the disk simultaneously.
- 4KiB Q8T8: Random read/write of 4KiB blocks with a queue depth of 8 and 8 threads. Emulates the load when multiple applications access small files simultaneously.
- Seq: Simple sequential read/write.
- 4KiB Q1T1: Random read/write of 4KiB blocks with a queue depth of 1 and 1 thread. Emulates the load when a single application accesses small files.
- Seq Read/Write: Sequential read/write speed in MB/s. High values are important for working with large files (for example, videos, archives).
- 4KiB Q32T1 Read/Write: Random read/write speed of 4KiB blocks with a large queue depth. Important for the performance of databases and virtual machines.
- 4KiB Q1T1 Read/Write: Random read/write speed of 4KiB blocks with a small queue depth. Important for system responsiveness and fast application startup.
| Disk Type | Seq Read (MB/s) | Seq Write (MB/s) | 4KiB Q32T1 Read (MB/s) | 4KiB Q32T1 Write (MB/s) |
|---|---|---|---|---|
| HDD (7200 RPM) | 100-200 | 100-200 | ~1 | ~1 |
| SSD (SATA) | 500-550 | 450-500 | 250-350 | 200-300 |
| 2000-3500 | 1500-3000 | 400-600 | 300-500 | |
| SSD (NVMe PCIe 4.0) | 5000-7000 | 4000-6000 | 600-800 | 500-700 |
Optimize Your VDS: Find Your Perfect Server!
Regardless of your test results, find the ideal solution for your needs. Our dedicated servers offer flexibility and performance.
Find Your Server →