我有两个相同的 Linux 机器(运行 ubuntu 13.4),硬件相同,包括 WDC WD20EARS 硬盘。我注意到我的主系统异常缓慢,并执行了许多 HD 测试。SMART 看起来没有可疑之处,并且在两台机器上给出了几乎相同的结果。
不过,有一项测试我发现了很大的差异,这是 hdparm 的高清速度测试。在有问题的机器上,我得到
> sudo hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads: 24876 MB in 2.00 seconds = 12450.96 MB/sec
Timing buffered disk reads: 26 MB in 3.18 seconds = 8.18 MB/sec
而在另一台(相同的)机器上我得到
> sudo hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads: 29000 MB in 2.00 seconds = 14515.76 MB/sec
Timing buffered disk reads: 348 MB in 3.01 seconds = 115.56 MB/sec
我在其他空闲的机器上测试了几次,但“缓冲磁盘读取”的巨大差异仍然存在。
知道是什么原因造成的吗?可以做些什么来解决?我还查看了诊断 hdparm 输出,但没有得到任何线索,因为两台机器的输出相同。这些机器大约有 1 年的历史,有 16GB 内存。
任何提示都将不胜感激 - 提前致谢
答案1
我认为,如果你在空闲的机器上测试,结果是可靠的。我在我的工作站上使用过这个命令,它工作得还不错。我怀疑你的硬盘/连接出了问题。
根据手册hdparm
:
-t Perform timings of device reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active
processes) with at least a couple of megabytes of free memory. This displays the speed of reading through the buffer cache to the disk without any prior caching of data. This measurement
is an indication of how fast the drive can sustain sequential data reads under Linux, without any filesystem overhead. To ensure accurate measurements, the buffer cache is flushed during
the processing of -t using the BLKFLSBUF ioctl.
-T Perform timings of cache reads for benchmark and comparison purposes. For meaningful results, this operation should be repeated 2-3 times on an otherwise inactive system (no other active
processes) with at least a couple of megabytes of free memory. This displays the speed of reading directly from the Linux buffer cache without disk access. This measurement is essentially
an indication of the throughput of the processor, cache, and memory of the system under test.