-
Notifications
You must be signed in to change notification settings - Fork 950
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
feature: add cpu period and quota for containers #1067
feature: add cpu period and quota for containers #1067
Conversation
8002a71
to
ce44269
Compare
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
ce44269
to
5940044
Compare
Codecov Report
@@ Coverage Diff @@
## master #1067 +/- ##
==========================================
+ Coverage 16.48% 16.48% +<.01%
==========================================
Files 158 159 +1
Lines 8841 8783 -58
==========================================
- Hits 1457 1448 -9
+ Misses 7281 7231 -50
- Partials 103 104 +1
|
@@ -28,3 +28,25 @@ func setupCgroupCPUSet(ctx context.Context, meta *ContainerMeta, spec *SpecWrapp | |||
cpu.Mems = meta.HostConfig.CpusetMems | |||
return nil | |||
} | |||
|
|||
func setupCgroupCPUPeriod(ctx context.Context, meta *ContainerMeta, spec *SpecWrapper) error { |
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.
as I said in #1031, this kind of spec implement not very good, like this fucntion, if s.Linux.Resources.CPU == nil
has been judged twice here, or maybe more times in other function.
These commit has no related with this pr.
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.
Thanks a lot for your comment. I totally agree with you. Spec related construction needs refactoring.
LGTM |
Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com
Ⅰ. Describe what this PR did
This adds
--cpu-quota
and--cpu-period
to container options.--cpu-period
should be in range [1000,1000000], and--cpu-quota
should be in [1000, ∞).Ⅱ. Does this pull request fix one issue?
fixes #1031
Ⅲ. Describe how you did it
none
Ⅳ. Describe how to verify it
none
Ⅴ. Special notes for reviews
none