-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Add support for blkio.weight_device #13959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for blkio.weight_device #13959
Conversation
53cf8fc to
c0109a9
Compare
5a03dc4 to
383af16
Compare
|
can you add an integration-cli test, other wise i see nothing wrong here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops my b i see this now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we could use a valid one too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jfrazelle I planted to add a valid one. But it seems it's not easy to find out what block device does the janky have.
|
@Mashimiao Thanks for the contrib! Please see the comments above. |
6cd23b8 to
f51f5f1
Compare
man/docker-create.1.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add (device:weight)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
f03555e to
ecef677
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your fault, but it looks like the rest of this example uses tabs for indentation 😞
Can you change to tabs to match the other lines? (just for this instance, because we normally use spaces)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ecef677 to
682f892
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mashimiao Thank you for the contribution. You missed some tics in there and there are also some slightly awkward structs. Please move the note which states a limitation to the top of the section.
Block IO bandwidth (Blkio) constraint
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.
Note: The blkio weight setting is only available for direct IO. Buffered IO
is not currently supported.
The --blkio-weight flag takes a weight between 10 to 1000.
For example, the commands below create two containers with different blkio
weight:
$ docker run -ti --name c1 --blkio-weight 300 ubuntu:14.04 /bin/bash
$ docker run -ti --name c2 --blkio-weight 600 ubuntu:14.04 /bin/bashIf you do block IO in the two containers at the same time, for example:
$ time dd if=/mnt/zerofile of=test.out bs=1M count=1024 oflag=directYou'll find that the proportion of time is the same as the proportion of blkio
weights of the two containers.
The --blkio-weight-device="DEVICE_NAME:WEIGHT" flag sets a specific device
weight. The DEVICE_NAME:WEIGHT is a string containing a colon-separated device
name and weight. For example, to set /dev/sda device weight to 200:
$ docker run -it \
--blkio-weight-device "/dev/sda:200" \
ubuntuIf you specify both the --blkio-weight and --blkio-weight-device, Docker
uses the --blkio-weight as the default weight and uses --blkio-weight-device
to override with a different weight on a specific device. The following example uses a default weight of 300 and overrides this default
on /dev/sda setting with a weight of 200:
$ docker run -it \
--blkio-weight 300 \
--blkio-weight-device "/dev/sda:200" \
ubuntuThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mashimiao did you push your changes? I see the note is still at the bottom (havent checked other changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah sorry, I forgot to push my changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A pfew almost thought I needed new glasses 👓 haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
erm, but I still don't see the changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thaJeztah Sorry, forgot to modify. Already fixed
d3b8572 to
4a1a8e5
Compare
Signed-off-by: Ma Shimiao <[email protected]>
4a1a8e5 to
0fbfa14
Compare
|
Thanks @Mashimiao! docs LGTM ping @moxiegirl PTAL |
|
LGTM thank you @Mashimiao for your patience. @thaJeztah as you like sir! |
|
restarting the userns and windows builds for good measure |
|
@thaJeztah it's green, merging 😉 |
Add support for blkio.weight_device
Signed-off-by: Ma Shimiao [email protected]