Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Support host config cpus #959

Open
liuqiyuan opened this issue Jan 6, 2018 · 10 comments
Open

Support host config cpus #959

liuqiyuan opened this issue Jan 6, 2018 · 10 comments
Labels
enhancement help wanted pinned exempt from being marked as stale

Comments

@liuqiyuan
Copy link

liuqiyuan commented Jan 6, 2018

Description

Support host config --cpus=<value>

I know we have workaround, but it will be good to have --cpus.

set --cpus="1.5", the container will be guaranteed to be able to access at most one and a half of the CPUs. This is the equivalent of setting --cpu-period="100000" and --cpu-quota="150000". Available in Docker 1.13 and higher.

@davidxia
Copy link
Contributor

@liuqiyuan Thanks for reporting. PRs are welcome :)

@stale
Copy link

stale bot commented Sep 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 24, 2018
@davidxia davidxia added enhancement help wanted pinned exempt from being marked as stale and removed stale labels Sep 24, 2018
@rwmajor2
Copy link

@liuqiyuan Can someone please merge this request? Why hasn't this been incorporated?

@davidxia
Copy link
Contributor

@rwmajor2 We can't merge this bc #1034 isn't finished. If you want to pick it up, we can review it.

@rwmajor2
Copy link

@davidxia What's not finished with it? Just curious.

@davidxia
Copy link
Contributor

@rwmajor2 If someone can rebase it, answer my question in that PR, and test that it actually works, I'm happy to merge it.

@laureled
Copy link

@davidxia I may be interested in picking this up. The field name in the PR seems incorrect. Should I update the PR or make a new one?

@davidxia
Copy link
Contributor

@laureled Whatever's easier for you :)

@laureled
Copy link

laureled commented Jun 5, 2019

I was able to accomplish this with cpuPeriod and cpuQuota. --cpus doesn't seem to exist in the Docker API. It seems to be a convenience option in the Docker CLI for setting period and quota. I was able to confirm this by creating a container with --cpus and inspecting it. Perhaps someone wants to double-confirm with the Docker source code. I think issues here relating to the --cpus option can be closed.

@dmandalidis
Copy link
Contributor

Hi @laureled ,

Since this project went on mature status, please re-open this issue (if it still stands) to https://github.com/dmandalidis/docker-client. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement help wanted pinned exempt from being marked as stale
Projects
None yet
Development

No branches or pull requests

5 participants