SCST-project / scst

SCST is a SCSI target software stack that allows to export any block device or file via iSCSI, FC or RDMA (SRP).
http://scst.sourceforge.net
93 stars 34 forks source link

how to limit scst read/wrtie iops with cgroup-v2? #227

Open zhujing3 opened 7 months ago

zhujing3 commented 7 months ago

Proceed as follows: using cgroup-v1

on scst server:

  1. add device to vdisk hankder
  2. create a iscsi target,add lun & initor
  3. echo "230:256 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device

on client:

  1. login iscsi target
  2. run dd: dd iflag=direct if=/dev/sdb of=/dev/null bs=4k count=1024

the results are consistent with expectations:

1024+0 records in
1024+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 4.00212 s, 1.0 MB/s

================= cgroup v2:

i have add all iscsi/scst/lun-name-process,even all system process to cgroup.procs , finally it's only works on scst-server :

dd iflag=direct if=/dev/zd256 of=/dev/null bs=4k count=1024 
1024+0 records in
1024+0 records out
4194304 bytes (4.2 MB, 4.0 MiB) copied, 4.00212 s, 1.0 MB/s

on client, doesn't work at all

=============

the problem:

how to find those process for scst read/write on disk ?