By default, all containers get the same proportion of block IO bandwidth
(blkio). This proportion is 500. To modify this proportion, change the
container's blkio weight relative to the weighting of all other running
containers using the --blkio-weight
flag.
The --blkio-weight
flag can set the weighting to a value between 10 to 1000.
For example, the commands below create two containers with different blkio
weight:
$ sudo docker run -ti --name c1 --blkio-weight 300 ubuntu:14.04 /bin/bash
$ sudo docker run -ti --name c2 --blkio-weight 600 ubuntu:14.04 /bin/bash
If you do block IO in the two containers at the same time, by, for example:
time dd if=/mnt/zerofile of=test.out bs=1M count=1024 oflag=direct
You'll find that the proportion of time is the same as the proportion of blkio weights of the two containers.
Note: The blkio weight setting is only available for direct IO. Buffered IO is not currently supported.