Article Title: Use hdparm in Linux to optimize hard drive performance. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The following content mainly refers to the hdparm in Linux Server Hacks to fine-tune the IDE drive parameters.
Below are some tests I have made on my own machine.
By default, the Linux system we use is very conservative when accessing the IDE device. The purpose of this setting is to protect data security and system compatibility, so that any hardware can be supported (such as 386 and 486). We can run the following command to view the performance of the current Hard Disk:
The following content mainly refers to the hdparm in Linux Server Hacks to precisely adjust the IDE driver parameters. Below are some tests I have made on my own machine.
By default, the Linux system we use is very conservative when accessing the IDE device. This setting aims to protect data security and system compatibility, so that any hardware can be supported (such as 386 and 486) run the following command to view the performance of the current Hard Disk: hdparm-Tt/dev/hda.
The result is as follows:
Root @ serv1 :/# Hdparm-Tt/dev/hda
/Dev/hda:
Timing cached reads: 1200 MB in 2.00 seconds = 600.00 MB/sec
Timing buffered disk reads: 76 MB in 3.02 seconds = "25.17 MB/sec
-T is a cache testing system.
-T: Report the disk status and read the cached data.
The above data is tested on P4 1.7G/512 M memory/40g ide machine.
Note: It is best to use this test in single-user mode, because this ensures that only you are using the system during the test to ensure the test accuracy. Perform the test several times to obtain the average value.
Run the following command to check how hdparm/dev/hda can be handled by hard disk in linux.
The result is as follows:
/Dev/hda:
Multcount = 16 (on)
IO_support = "0 (default 16-bit)
Unmaskirq = "0 (off)
Using_dma = "1 (on)
Keepsettings = "0 (off)
Readonly = "0 (off)
Readahead = "8 (on)
Geometry = 5169/240/63, sectors = 40020664320, start = 0
We can see that the 16-Bit mode is used by default.
Optimization
Run the following command:
Hdparm-m16-c3/dev/hda
This allows IO_support to work in 32-Bit mode.
The test results here do not seem to improve much. You can also see how your results are.