我有两台服务器,一台配有 SSD,一台配有 HDD。我一直在运行 hdparm 来查看差异,但缓存读取时间和时间的结果相当相等/HDD 更快:
固态硬盘:
Timing cached reads: 26080 MB in 2.00 seconds = 13053.64 MB/sec
Timing buffered disk reads: 1558 MB in 3.00 seconds = 518.77 MB/sec
Timing O_DIRECT cached reads: 966 MB in 2.00 seconds = 482.99 MB/sec
Timing O_DIRECT disk reads: 1528 MB in 3.00 seconds = 508.71 MB/sec
硬盘:
Timing cached reads: 28248 MB in 2.00 seconds = 14137.88 MB/sec
Timing buffered disk reads: 496 MB in 3.01 seconds = 164.78 MB/sec
Timing O_DIRECT cached reads: 994 MB in 2.00 seconds = 496.24 MB/sec
Timing O_DIRECT disk reads: 486 MB in 3.01 seconds = 161.55 MB/sec
SSD 上的缓冲磁盘读取速度更快,但我不确定是否应该担心上述性能?如果必要/可能,我该如何改进?
答案1
缓存的读取并非来自底层设备。它们根本不能代表不同设备的性能,任何设备都无法达到这种吞吐量。忽略该数字。