内存 数据库,存储 网络缓存

Fio工具业余性研究(三)

2018-07-04  本文已影响55人  Stansosleepy

1、背景

fio涉及到随机读、随机写的参数有这么几个,他们对fio的randwrite和randread时候随机的io的位置有关

2、随机读写的一些相关参数

在fio的测试参数中这几个参数会决定在哪个范围内做随机的io

debug fio的随机读写的方法
加上debug参数执行测试,可以看到每个随机出来的单独的io_u使用的lba地址
fio --debug=io,random jobfile

3、randrepeat和allrandrepeat

randrepeat的意思其实非常的简单:就是说这次随机读、随机写测试产生的位置是可重复的。这里的“可重复”的实现方式仅仅是通过randseed=默认值来实现。

4、random_generator

随机数的生成器一共有三个,tausworthe(默认)、tausworthe64、lfsr
fio文档里面的解释非常清晰:

tausworthe  is  a  strong  random number generator, but it requires tracking on the side if we want to ensure that blocks are only read or written once. 
lfsr guarantees that we never generate the same offset twice, and it's also less computationally expensive. It's not a true random generator, 
however, though for I/O purposes it's typically good enough. lfsr only works with single block sizes, not with workloads that use multiple block sizes. 
If used with such a workload, fio may read or write some blocks multiple times. The default value is tausworthe,  unless  the  required  
space exceeds 2^32 blocks. If it does, then tausworthe64 is selected automatically.

5、random_distribution

随机分布参数指的是,fio可以模拟某些lba区域的随机概率高,某些区域随机概率低,模拟随机数据的冷热性。

6、norandommap和softrandommap

norandommap:如果不加这个参数,fio执行随机的时候就是有randommap的,fio会使用一段内存(bitmap)来记录是不是随机到重复的位置,如果随机到重复的位置,那么fio会再去找一个不重复的位置。如果设置了这个参数,同时配合上真随机random_generator,那么会产生重复位置的io_u

注意:

上一篇 下一篇

猜你喜欢

热点阅读