I ran a docker container with several process in it. I want to limit the iops/bps of a child process and I try to use cgroups to do that, but failed.
I create a cgroups by
mkdir /sys/fs/cgroup/blkio/example echo "7:3 1048576" > /sys/fs/cgroup/blkio/example/blkio.throttle.read_bps_device # use `ps aux` to find out the pid echo <pid> > /sys/fs/cgroup/blkio/example/tasks
When I use
iotop to get the io status, I found the
DISK READ of the process not limited.
However, if a process running on host is added to that cgroups, it works.
I want to know is there something wrong in my steps using cgroups, and is it a reasonable approach to use cgroups in docker.