summaryrefslogtreecommitdiff
path: root/draft/limit-io.txt
blob: 04307bb0f40a54257e12765e60e399f8b300e67c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mount -t tmpfs cgroup_root /sys/fs/cgroup
mkdir -p /sys/fs/cgroup/blkio
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio


dev=/dev/sda
limit=10485760 # 10MBps
mycg=/sys/fs/cgroup/blkio/limit_write/

devnode=$(stat -c'%t:%T' /dev/sda)
mkdir -p $mycg
echo "$devnode $limit" > $mycg/blkio.throttle.write_bps_device 

echo $PID > $mycg/tasks