Press "Enter" to skip to content

Benchmark Linux Disk Read/Write Speed

johnyan 0

hdparm is a command line utility to set and view hardware parameters of hard disk drives. It can also be used as a simple benchmarking tool.

Install hdparm

CentOS

[[email protected] ~]# yum install hdparm

Ubuntu

[email protected]:~# apt-get install hdparm

Benchmarking Read Speed

on GCP CentOS7

[[email protected] ~]# sudo hdparm -Tt /dev/sda1 hdparm 

/dev/sda1:
 Timing cached reads:   19088 MB in  1.99 seconds = 9592.65 MB/sec
 Timing buffered disk reads: 380 MB in  3.02 seconds = 125.97 MB/sec
hdparm: No such file or directory

on OCP Ubuntu18

[email protected]:~# sudo hdparm -Tt /dev/sda hdparm

/dev/sda:
 Timing cached reads:   7746 MB in  2.00 seconds = 3875.67 MB/sec
 Timing buffered disk reads: 208 MB in  3.19 seconds =  65.18 MB/sec
hdparm: No such file or directory
[email protected]:~# time dd if=/dev/zero of=/tmp/test.dat bs=1G count=1
dd: memory exhausted by input buffer of size 1073741824 bytes (1.0 GiB)

real    0m0.021s
user    0m0.000s
sys     0m0.015s

Benchmarking Write Speed

on GCP CentOS7

[[email protected] ~]# time dd if=/dev/zero of=/tmp/test.dat bs=300M count=1
1+0 records in
1+0 records out
314572800 bytes (315 MB) copied, 8.54975 s, 36.8 MB/s

real    0m8.585s
user    0m0.000s
sys     0m0.471s

on OCP Ubuntu18

[email protected]:~# time dd if=/dev/zero of=/tmp/test.dat bs=300M count=1
1+0 records in
1+0 records out
314572800 bytes (315 MB, 300 MiB) copied, 4.46503 s, 70.5 MB/s

real    0m4.509s
user    0m0.000s
sys     0m0.878s

I am working on a comparison table for local ssd, AWS, Azure, GCP, OCP free tier’s read/write benchmarking. Hopefully we can have a better idea how those providers’ free offer looks like.

Read Write
Oracle Cloud        64.86 MB/sec        68.8 MB/s
Google Cloud        122.98 MB/sec        37.4 MB/s
Azure Cloud        81.15 MB/sec        68.5 MB/s
AWS Cloud          81.13 MB/sec        82.5 MB/s

Local SSD              471.29 MB/sec        81.2MB/s

Youtube Video:

Leave a Reply

Your email address will not be published. Required fields are marked *