cgroup blkio throttle does not work on root group
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
from kernel document, https:/
```
Throttling/Upper Limit policy
-------
- Enable Block IO controller
CONFIG_
- Enable throttling in block layer
CONFIG_
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)
mount -t cgroup -o blkio none /sys/fs/
- Specify a bandwidth rate on particular device for root group. The format
for policy is "<major>:<minor> <bytes_
echo "8:16 1048576" > /sys/fs/
Above will put a limit of 1MB/second on reads happening for root group
on device having major/minor number 8:16.
- Run dd to read a file and see if rate is throttled to 1MB/s or not.
# dd iflag=direct if=/mnt/
1024+0 records in
1024+0 records out
4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s
Limits for writes can be put using blkio.throttle.
```
tested with ubuntu 16.04(xenial) and seems throttle not working, but on my virtual machine, ubuntu 14.04(trusty) works.
```
ubuntu16.04(xenial)
root@i-x3mn8m8i:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 20G 0 disk
`-vda1 253:1 0 20G 0 part /
vdb 253:16 0 1G 0 disk [SWAP]
root@i-x3mn8m8i:~# dd if=/dev/zero of=test.img bs=4k oflag=direct
^C16246+0 records in
16246+0 records out
66543616 bytes (67 MB, 63 MiB) copied, 3.15081 s, 21.1 MB/s
root@i-x3mn8m8i:~# echo 253:0 1000 > /sys/fs/
root@i-x3mn8m8i:~# dd if=/dev/zero of=test.img bs=4k oflag=direct
^C26702+0 records in
26702+0 records out
109371392 bytes (109 MB, 104 MiB) copied, 5.2413 s, 20.9 MB/s
ubuntu14.04(trusty)
root@i-ulhx27oo:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 20G 0 disk
`-vda1 253:1 0 20G 0 part /
vdb 253:16 0 1G 0 disk [SWAP]
root@i-ulhx27oo:~# dd if=/dev/zero of=test.img bs=4k oflag=direct
^C27679+0 records in
27679+0 records out
113373184 bytes (113 MB) copied, 5.43766 s, 20.8 MB/s
root@i-ulhx27oo:~# echo 253:0 1000 > /sys/fs/
root@i-ulhx27oo:~# dd if=/dev/zero of=test.img bs=4k oflag=direct
^C7553+0 records in
7553+0 records out
30937088 bytes (31 MB) copied, 7.60268 s, 4.1 MB/s
```
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1760375
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.