linux磁盘性能测试

120-test:/# apt-get install hdparm


真实机器120上测试结果:


测试磁盘性能(不cache)


120-test:/home/lai# hdparm -t /dev/sda


/dev/sda:
 Timing buffered disk reads:  346 MB in  3.02 seconds = 114.65 MB/sec


测试磁盘性能(带cache)


120-test:/home/lai# hdparm -T /dev/sda


/dev/sda:
 Timing cached reads:   2786 MB in  2.00 seconds = 1393.80 MB/sec




真实机器121上测试结果:


121:~# hdparm -t /dev/sda


/dev/sda:
 Timing buffered disk reads:  310 MB in  3.01 seconds = 102.89 MB/sec
121:~# hdparm -T /dev/sda


/dev/sda:
 Timing cached reads:   2578 MB in  2.00 seconds = 1289.01 MB/sec


服务器sas硬盘测试结果:


lai@*:~$ sudo hdparm -t /dev/sda


/dev/sda:
 Timing buffered disk reads:  442 MB in  3.01 seconds = 146.89 MB/sec
lai@*:~$ sudo hdparm -T /dev/sda


/dev/sda:
 Timing cached reads:   8306 MB in  2.00 seconds = 4162.04 MB/sec


 


 


虚拟机的测试结果1:


HA:/home/lai# hdparm -t /dev/sda


/dev/sda:
 Timing buffered disk reads:  176 MB in  3.01 seconds =  58.51 MB/sec
HA:/home/lai# hdparm -T /dev/sda


/dev/sda:
 Timing cached reads:   2966 MB in  2.00 seconds = 1483.26 MB/sec


 


虚拟机的测试结果2:


153:/home/lai# hdparm -t /dev/sda


/dev/sda:
 Timing buffered disk reads:  186 MB in  3.00 seconds =  61.93 MB/sec
153:/home/lai# hdparm -T /dev/sda


/dev/sda:
 Timing cached reads:   3012 MB in  2.00 seconds = 1505.78 MB/sec


hdparm优化硬盘
 
hdparm -tT /dev/hda 测试硬盘速度
hdparm -A1 /dev/hda 开启硬盘预读取功能
hdparm -c3 /dev/hda 开启硬盘32位
hdparm -d1 /dev/hda 开启DMA
-d 和 -A 参数对IDE硬盘读写性能影响最大(尤 -d)
关闭预读
121:~# hdparm -A 0 /dev/sda
/dev/sda:
 setting drive read-lookahead to 0 (off)
 look-ahead    =  0 (off)
121:~# hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   2454 MB in  2.00 seconds = 1227.17 MB/sec
 Timing buffered disk reads:   26 MB in  3.02 seconds =   8.60 MB/sec
开启预读
121:~# hdparm -A 1 /dev/sda
/dev/sda:
 setting drive read-lookahead to 1 (on)
 look-ahead    =  1 (on)
121:~# hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   2586 MB in  2.00 seconds = 1293.30 MB/sec
 Timing buffered disk reads:  312 MB in  3.00 seconds = 103.93 MB/sec

你可能感兴趣的:(linux,虚拟机,cache,测试,disk,磁盘)