Disk I/O throttle (mbps_rd/iops_rd) not working on local-zfs - KVM

marciglesias17

Well-Known Member
Feb 12, 2020
47
0
46
27
Dark fiber
Hello,

I've configured disk I/O limits on a KVM VM but they are not being applied. The limits show correctly in the GUI but fio inside the guest returns full unthrottled disk performance.

VM config:
scsi0: local-zfs:vm-142-disk-1,iops_rd=1000,iops_rd_max=3000,iops_wr=1000,iops_wr_max=3000,iothread=1,mbps_rd=50,mbps_rd_max=150,mbps_wr=50,mbps_wr_max=150,size=100G
scsihw: virtio-scsi-single

Configured limits:
mbps_rd / mbps_wr: 50 MB/s
mbps_rd_max / mbps_wr_max: 150 MB/s
iops_rd / iops_wr: 1000
iops_rd_max / iops_wr_max: 3000

The limits are completely ignored. Running fio inside the guest:

Sequential write: ~2500 MB/s (limit is 50 MB/s)
Sequential read: ~6900 MB/s (limit is 50 MB/s)
Random IOPS read: ~340,000 (limit is 1,000)
Random IOPS write: ~144,000 (limit is 1,000)

Already tested, no difference:
- virtio0 vs scsi0
- iothread on/off
- aio: io_uring, native, threads
- cache: none, writeback
- fio with direct=1 and direct=0

QEMU does create the throttle group (visible in error logs), but it doesn't limit anything.

Has anyone got I/O limits working on local-zfs? Any workaround?

Thanks