Performance Testing the HDD/SSD/NVme Hard Disk speed on VPS/Dedicated Server


Before your purchase VPS or dedicated server, it is recommended to have some tests on the performance of the HDD or especially SSD (so you know if they are telling the truth) on the server.

It is better to pay monthly the fee, so if you spot any thing unusual or if you are not completely satisfied, you can switch to another provider. I always tend to trust the VPS, so I paid annually and I get one month discount.

hdparm

hdparm can be used to get/set the disk information, if you don’t have it, you can install by using:

1
sudo apt-get install hdparm
sudo apt-get install hdparm

Or, if you use yum installer:

1
yum install hdparm
yum install hdparm

We need to specify which hard disk partition, the first HDD is usually /dev/sda1, the second is /dev/sda2 or /dev/sdb1 etc.

1
hdparm -tT /dev/sda1
hdparm -tT /dev/sda1

Under my VPS server, the test results are:

/dev/sda1:
 Timing cached reads:   10398 MB in  1.99 seconds = 5220.48 MB/sec
 Timing buffered disk reads: 378 MB in  3.01 seconds = 125.73 MB/sec

The other result tested is on Raspberry PI B model that is using 32GB SD card.

/dev/sda1:

 Timing cached reads:   324 MB in  2.00 seconds = 161.67 MB/sec
 Timing buffered disk reads:  74 MB in  3.00 seconds =  24.65 MB/sec

dd

dd command can be used to copy in/out blocks of data. We use the following command to test the performance of the disk.

1
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync

if specifies the input if it is not std-in. of specifies the output if it is not std-out. The bs specifies the size of the block (read and write), and conv=fdatasync requires the data written to disk before exit otherwise the data may be in the cache, which produces incorrect result.

On my VPS, the testing shows the following results:

16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 23.571 s, 45.6 MB/s

On Raspberry PI B model (32 GB SD card), it is a bit slow.

16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 65.3898 s, 16.4 MB/s

There is a big difference regarding to the disk performance between HDD and SD Card. Remember to remove the file by rm -f test after you finish the test. The file consumes 1GB disk space (16K multiplies 64K = 1GB)

See also: Speed Comparison of SSD and NVme on Contabo VPS

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
586 words
Last Post: Greedy Algorithm to Reach the Last Index of the Array
Next Post: How to Show Links Only on Home Pages of WordPress Blogs?

The Permanent URL is: Performance Testing the HDD/SSD/NVme Hard Disk speed on VPS/Dedicated Server

Leave a Reply