fio -filename=/data1/test_randread -direct=1 -iodepth 1 -thread -rw=randread -ioengine=psync -bs=4k -size=20G -numjobs=10 -runtime=60 -group_reporting -name=mytest -ioscheduler=deadline

同样机型配置下,使用上述命令的iops竟然相差接近2w

/opt/MegaRAID/MegaCli/MegaCli64  -LDGetProp -Cache -L0 -a0

通过上面的命令可以看到缓存设置的一个是direct和cached,在随机读的模式下使用cached的模式,iops表现要比direct模式差,分析可能是随机读基本都是不命中缓存,导致缓存每次都要去更新缓存内的数据,反而导致随机读性能没有direct性能好;在我们实际的场景中,还基本数据读取都具有集中性,所以开启读缓存还是很有必要的。 通过下面的命令可以设置某个vg的raid cache缓存模式:

-ldsetprop  -cached/direct  -L0 -a0

通过下面的命令可以设置磁盘的cache模式:

-ldsetprop  -endskcache  -L0 -a0

results matching ""

    No results matching ""