Using rwmixread and rate_iops in fio

Creating a mixed read/write workload with fio can be a bit confusing. Assume we want to create a fixed rate workload of 100 IOPS split 70:30 between reads and writes.

Don’t mix rwmixread and rate_iops
TL;DR

Specify the rate directly with rate_iops=<read-rate>,<write-rate> do not try to use rwmixread with rate_iops. For the example above use.

rate_iops=70,30 

Additionally older versions of fio exhibit problems when using rate_poisson with rate_iops . fio version 3.7 that I was using did not exhibit the problem.

Longer Answer

We might try the following and use rwmixread together with rate_iops. This is appealing because we would like to specify a single toatal IOP rate with rate_iops, then manipulate the skew with a single value rwmixread. Unfortunately that’s not how it works.

Incorrect

[global]
rw=randrw
bs=8k
ioengine=libaio
direct=1
iodepth=32

[sdb]
rwmixread=70
rate_iops=100
filename=/dev/sdb
size=20G

Doing the above will actually generate 200 iops with 100 read, and 100 write IOPS. This is because rate_iops=100 is really just shorthand for rate_iops=100,100. Unfortunately rwmixread has no effect at all

Correct

To create a specific fixed r/w rate we have to specify the read and write rates explicitly using rate_iops=<read-rate>,<write-rate>.

[global]
rw=randrw
bs=8k
ioengine=libaio
direct=1
iodepth=32

[sdb]
rate_iops=70,30
filename=/dev/sdb

2 comments on “Using rwmixread and rate_iops in fio

  • Mark Butterworth says:

    The rwmixread works when you do not specify the rate_iops. For example in my test…

    READ: bw=3133MiB/s (3285MB/s), 3133MiB/s-3133MiB/s (3285MB/s-3285MB/s), io=30.6GiB (32.9GB), run=10001-10001msec
    WRITE: bw=2093MiB/s (2195MB/s), 2093MiB/s-2093MiB/s (2195MB/s-2195MB/s), io=20.4GiB (21.9GB), run=10001-10001msec

    You can see I had rwmixread=60 set so 60% of IO is reads and the rest writes.

    Reply
    • Good to know, thanks Mark. This confirms that `rmixread` works in isolation, as does `rate_iops` in isolation – but not in combination.

      Reply

Leave a Comment