最近在做一个站点,图片有点多。全放到web目录下(没有采用第三方存储) 新打开一个站点时,要加载很多图片。。。这时我ssh在服务器上敲命令时,瞬间很卡。。。突然意识到,是磁盘io问题(之前也遇到过,以为可能是网络或者load问题)大家有遇到过我这样的情况吗? 今天测试了下,阿里云vps测试结果如下: 1. 写速度 time dd if=/dev/zero of=test.db bs=1M count=1024 conv=fdatasync 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 23.2556 s, 46.2 MB/s
real 0m23.265s user 0m0.000s sys 0m1.520s
2. 读速度 time dd if=test.db of=/dev/null bs=1M 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 15.0304 s, 71.4 MB/s
real 0m15.041s user 0m0.004s sys 0m1.128s
本地电脑虚拟机测试结果 1. 写 time dd if=/dev/zero of=test.db bs=1M count=1024 conv=fdatasync 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 12.0661 s, 89.0 MB/s
real 0m12.247s user 0m0.012s sys 0m2.288s
2. 读 time dd if=test.db of=/dev/null bs=1M 1024+0 records in 1024+0 records out 1073741824 bytes (1.1 GB) copied, 0.420771 s, 2.6 GB/s