Difference between revisions of "How to test the access speed of a Linux disk drive"
Line 1: | Line 1: | ||
− | The access speed of a disk drive attached to a Linux system can tested using the Linux ''hdparm'' utility. ''hdparm'' is supplied as standard with most linux distributions and essentially provides a command-line interface to the Linux disk device driver subsystem. | + | The access speed of a disk drive attached to a Linux system can be tested using the Linux ''hdparm'' utility. ''hdparm'' is supplied as standard with most linux distributions and essentially provides a command-line interface to the Linux disk device driver subsystem. |
− | ''hdparm'' supports a number of useful command-line options, although a number of the options reconfigure drive settings and such options be used with great care (if at all). As far as testing the access speed of the device, however, the ''-T'' and ''-t'' flags are of particular interest. | + | ''hdparm'' supports a number of useful command-line options, although a number of the options reconfigure drive settings, and such options be used with great care (if at all). As far as testing the access speed of the device, however, the ''-T'' and ''-t'' flags are of particular interest. |
− | The ''-T'' flag performs a speed test on the Linux buffer cache and does not access the physical | + | The ''-T'' flag performs a speed test on the Linux buffer cache and does not access the physical disk drive. This is essentially a performance test of the system processor, cache and memory. |
The ''-t'' flag performs the speed of reading from the physical disk device through the buffer cache. This test provides an indication of how fast the drive can sustain sequential data reads. | The ''-t'' flag performs the speed of reading from the physical disk device through the buffer cache. This test provides an indication of how fast the drive can sustain sequential data reads. |
Revision as of 18:49, 19 March 2007
The access speed of a disk drive attached to a Linux system can be tested using the Linux hdparm utility. hdparm is supplied as standard with most linux distributions and essentially provides a command-line interface to the Linux disk device driver subsystem.
hdparm supports a number of useful command-line options, although a number of the options reconfigure drive settings, and such options be used with great care (if at all). As far as testing the access speed of the device, however, the -T and -t flags are of particular interest.
The -T flag performs a speed test on the Linux buffer cache and does not access the physical disk drive. This is essentially a performance test of the system processor, cache and memory.
The -t flag performs the speed of reading from the physical disk device through the buffer cache. This test provides an indication of how fast the drive can sustain sequential data reads.
When using the above flags it is recommended that the tests are repeated 2 or 3 times on an inactive system with at least 1 or 2 megabytes of memory available. Appropriate user permissions are also required to run this utility.
For example, assuming the hard disk is device /dev/sda, hdparm would be run as follows:
/sbin/hdparm -Tt /dev/sda
This will provide two lines of information along the lines of:
/dev/sda: Timing cached reads: 3652 MB in 2.00 seconds = 1827.27 MB/sec Timing buffered disk reads: 168 MB in 3.08 seconds = 54.50 MB/sec
The first line is the speed of the Linux Buffer Cache. The second line tells you the speed transfer rate of the drive.