Skip to content
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

Document new CPU scheduling flags #586

Merged
merged 1 commit into from
Dec 12, 2016
Merged

Document new CPU scheduling flags #586

merged 1 commit into from
Dec 12, 2016

Conversation

mdlinville
Copy link

Describe the proposed changes

Documented new CPU-related flags and tried to pull them together into a coherent topic

Unreleased project version

Engine 1.13

Related issue

Fixes #583

Related issue or PR in another project

moby/moby#23430 (review)

Please take a look

@justincormack @thaJeztah @erikstmartin

@mdlinville mdlinville added this to the engine/1.13.0 milestone Nov 15, 2016
@mdlinville
Copy link
Author

PTAL @cpuguy83

container gets access to CPU resources proportional to all other running
processes which need CPU resources. If your host machine and Docker daemon are
configured correctly, you can schedule Linux container tasks to have higher
priority access to CPU resources. If you need to, you can even schedule
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The options Docker provides are really more about being able to configure the resources that the RT scheduler should allot for it, but does not set the scheduler itself.

@mdlinville
Copy link
Author

@mlaventure PTAL, Brian nominated you. :)

@mdlinville
Copy link
Author

I realized that this needs to wait for #334 is merged into master, master is merged into vnext-engine, and this stuff needs to go into that topic instead of this new topic I've created. Just a note for me, no action for reviewers.

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
@mdlinville
Copy link
Author

OK, this work has now been refactored on top of #334. No extra review is needed because no facts were changed.

@mdlinville mdlinville merged commit 8c125c9 into docker:vnext-engine Dec 12, 2016
@mdlinville mdlinville deleted the 583_realtime_cpu_support branch December 12, 2016 19:33
@vincentwoo
Copy link
Contributor

I think this documentation should include more information about realtime scheduling and links to places to find out how to enable it for various distros. Docker introduced a pretty useful new feature without a great plan for users on how to actually get it running in prod. For instance, if you want to use --cpus, do you need to cap-add sys_nice to all your containers?

@mdlinville
Copy link
Author

@cpuguy83 do you have any info to help answer @vincentwoo's question?

@vincentwoo
Copy link
Contributor

There's a lot more information in the description/comments of the originating PR (moby/moby#23430) but no information in the documentation about how much of this is still needed, nor what their base assumptions are. I think it likely that many users (including myself) have no idea what "real time scheduling" is.

@mdlinville
Copy link
Author

I'm not sure how much about real-time scheduling as a computer science concept or a Linux kernel concept that Docker should be covering. I think in general there is an idea that "If you are not sure whether you need RT, you don't". I think we already link to the kernel references, and I'm not sure how far we should be going. I'll wait for @cpuguy83 or others to weigh in.

@vincentwoo
Copy link
Contributor

I completely disagree. The docs present the new cpu options as just-so. As in, simply pass these flags to your containers and they will be throttled accordingly. --cpus=1.5 seems like a great thing, and very easy for anyone to understand! The layout of the documentation makes it seem like you can just turn it on for any container because it appears under "Configure the default scheduler".

Then, the docs go on to describe a bunch of weird options, like realtime, or sys_nice, with no mention of why you might want to turn on those options. Is the reality that you actually need all of that stuff to use --cpus? Because from reading the other PR it seems like the answer is definitely, yes.

@vincentwoo
Copy link
Contributor

See also moby/moby#27958, which introduced --cpus on top of the previous PR. What's also very weird is all this instruction around "If you use Docker 1.13 or higher, use --cpus instead". ALL of these flags were introduced in 1.13, no?

@cpuguy83
Copy link
Contributor

cpuguy83 commented Feb 9, 2017

@vincentwoo I think you are mixing things up here.
--cpus configures CFS, and it works just as is.

If someone is using realtime workloads --cpus is not for them. The docs for --cpus is specifically under the CFS scheduler options.

These options seem well separated in the docs.

@mdlinville
Copy link
Author

Maybe it would help to see this content in context: https://docs.docker.com/engine/admin/resource_constraints/#/cpu

@vincentwoo
Copy link
Contributor

Oh jesus I finally understand. I apologize for my inability to understand the docs - did not realize that different PRs were talking about runtime vs cfs periods, ugh. apologies to all involved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants