0

I have several Docker containers running a virtual machine, and I would like to uniformly throttle disk I/O throughput by say 20% across all containers without actually imposing any kind of stress on other resources (i.e. CPU) on the machine.

I understand I can change the cgroups by changing the blkio weight of each container; however, Docker containers have the property that even if you limit the usage of a certain resource, it will use more than that limit if no other process is contending for that resource (perhaps there is a way to turn this off?).

One solution would be to simply start up another process that makes arbitrary disk reads (say, through dd). However, dd will also use significant CPU, so this is undesirable.

To summarize my question, I am looking for a way to throttle disk read utilization without using any of the other resources.

user3249763
  • 117
  • 3
  • 15

1 Answers1

0

There's a similar question here. Would --device-read-bps work for your case?

The --device-read-bps flag limits the read rate (bytes per second) from a device. For example, this command creates a container and limits the read rate to 1mb per second from /dev/sda:

$ docker run -it --device-read-bps /dev/sda:1mb ubuntu

If yes, we can probably mark this one as duplicate

Community
  • 1
  • 1
Roman
  • 19,581
  • 6
  • 68
  • 84
  • I would like to do this without restarting the container. It seems that 'docker update' only supports specifying the blk-weight. Also, it is not clear to me which device a container would be writing to. – user3249763 Nov 10 '16 at 01:38