How to test hard disk read and write speed in Linux

  
 

I will talk about how to use the command in Linux to test the read and write input of the hard disk. It may be used when setting up the server and purchasing the server to check the performance of the server.

Main Commands

The main command we use here is hdparm, and the parameters are as follows

  • -a Indicates whether to disable the disk prefetch function. For large file reads, this obviously improves performance.
  • -A Set the hard drive cache read feature. It may be the hard disk cache switch
  • -g Display the magnetic track, head, magnetic area and other parameters of the hard disk.
  • -i Displays the hardware specifications of the hard disk, which is provided by the hard disk itself at boot time.
  • -I Directly read the hardware specifications provided by the hard disk.
  • -p Set the PIO mode of the hard disk.
  • -Tt Evaluate the read efficiency of the hard disk and the read efficiency of the hard disk cache.
  • -u <0 or 1>; Allow other interrupts to be executed simultaneously while the hard disk is being accessed.
  • -v Displays the settings related to the hard disk.


    Instances


    Another method

    Linux hard disk write speed

    < Br> 1 # time dd if=/dev/test of=/var/test bs=2k count=1000000


    Linux hard disk read speed


    1 # time Dd if=/var/test of=/dev/null bs=2k


    Command details: time is used for timing dd for copying, read from if, write toofif=/dev/zero Does not generate IO, so it can be used to test the write speed; similarly, of=/dev/null does not generate IO, can be used to test the pure read speed bs is the size of each read or write, that is, the size of a block, count is The number of read and write blocks, multiplication is the amount of read and write data. The larger the amount of data, the more accurate it is. The average value of multiple tests is

  • Copyright © Windows knowledge All Rights Reserved