Hi,

I am trying to use “'throttle' block filter” mentioned at 
https://github.com/qemu/qemu/blob/master/docs/throttle.txt, however, it seems 
not work with the following steps, did I miss or mis-understand anything?

1. In RHEL 8.8, I created one vm

qemu-kvm -m 2048 -drive file=/virt/images/focal-server-cloudimg-amd64.img 
-drive file=/virt/disks/vm1_disk_1.qcow2 -drive 
file=/virt/disks/vm1_disk_2.qcow2 -serial stdio -vga virtio -display default 
-qmp tcp:localhost:4444,server,wait=off

2. telnet vm

telnet localhost 4444
{"execute": "qmp_capabilities"}

3. add a new data disk ()
{"execute": "blockdev-add", "arguments": {"node-name": "disk7", "driver": 
"qcow2", "file": {"driver": "file", "filename": 
"/virt/disks/vm1_disk_7.qcow2"}}}

4. create a new throttle group
{"execute": "object-add", "arguments": {"qom-type": "throttle-group", "id": 
"limit1", "limits": {"iops-total": 1000}}}

5. add a throttle filter to disk
{"execute": "blockdev-add", "arguments": {"driver": "throttle", "node-name": 
"throttle1", "throttle-group": "limit1", "file": "disk7"}}

6. associate the disk with vm
{"execute": "device_add", "arguments": {"driver": "virtio-blk", "id": "blk7", 
"drive": "disk7"}}

7. fio test within vm (limit is 1000, while fio gets 2445 in avg)
fio --name=mytest --ioengine=sync --rw=randwrite --bs=4k --size=20G --numjobs=1 
--time_based --runtime=300s --filename=/dev/vda

mytest: (g=0): rw=randwrite, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 
4096B-4096B, ioengine=sync, iodepth=1
fio-3.16
Starting 1 process
Jobs: 1 (f=1): [f(1)][100.0%][eta 00m:00s]
mytest: (groupid=0, jobs=1): err= 0: pid=959: Tue Oct 24 15:11:38 2023
  write: IOPS=2446, BW=9784KiB/s (10.0MB/s)(2867MiB/300016msec); 0 zone resets
    clat (usec): min=3, max=131566, avg=399.31, stdev=3128.70
     lat (usec): min=4, max=131568, avg=401.12, stdev=3128.72
    clat percentiles (usec):
     |  1.00th=[    5],  5.00th=[    6], 10.00th=[    6], 20.00th=[    6],
     | 30.00th=[    6], 40.00th=[    7], 50.00th=[    7], 60.00th=[    8],
     | 70.00th=[   10], 80.00th=[   11], 90.00th=[   29], 95.00th=[   94],
     | 99.00th=[23462], 99.50th=[23987], 99.90th=[31589], 99.95th=[33817],
     | 99.99th=[43779]
   bw (  KiB/s): min=  896, max=248856, per=99.98%, avg=9781.85, 
stdev=26238.98, samples=600
   iops        : min=  224, max=62214, avg=2445.43, stdev=6559.75, samples=600
  lat (usec)   : 4=0.01%, 10=76.84%, 20=11.91%, 50=3.37%, 100=3.29%
  lat (usec)   : 250=2.49%, 500=0.33%, 750=0.07%, 1000=0.04%
  lat (msec)   : 2=0.04%, 4=0.02%, 10=0.02%, 20=0.33%, 50=1.24%
  lat (msec)   : 100=0.01%, 250=0.01%
  cpu          : usr=1.32%, sys=4.32%, ctx=23971, majf=0, minf=11
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=0,733855,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
  WRITE: bw=9784KiB/s (10.0MB/s), 9784KiB/s-9784KiB/s (10.0MB/s-10.0MB/s), 
io=2867MiB (3006MB), run=300016-300016msec

Disk stats (read/write):
  vda: ios=0/660825, merge=0/17257, ticks=0/39116357, in_queue=38236828, 
util=98.23%

Reply via email to