- I will use
/dev/sdc
as our testing block device.
Note that all tests should be run multiple times and average time should be calculated to get more accurate result.
Bypassing hard drive’s buffer cache memory thus reading directly from the disk.
Read data from the second half of the disk that is if the hard drive size is 100GB.
To obtain cached reads run the following command:
1 2 3 4 |
# hdparm -t /dev/sdc /dev/sdc: Timing buffered disk reads: 114 MB in 3.04 seconds = 36.25 MB/sec |
Bypassing hard drive’s buffer cache memory thus reading directly from the disk.
1 2 3 4 |
# hdparm -t --direct /dev/sdc /dev/sdc: Timing O_DIRECT disk reads: 100 MB in 3.00 seconds = 33.31 MB/sec |
Read data from the second half of the disk that is if the hard drive size is 100GB.
1 2 3 |
hdparm --offset 50 -t /dev/sdc /dev/sdc: Timing buffered disk reads (offset 50 GB): 72 MB in 3.05 seconds = 23.61 MB/sec |
To obtain cached reads run the following command:
1 2 3 4 |
# hdparm --offset 50 -T /dev/sdc /dev/sdc: Timing cached reads: 4484 MB in 2.00 seconds = 2246.69 MB/sec |