-
Notifications
You must be signed in to change notification settings - Fork 948
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
blkiodev: limit blkio device's read/write Bps/IOps #2563
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2563 +/- ##
==========================================
- Coverage 69.17% 68.91% -0.27%
==========================================
Files 278 278
Lines 18623 18659 +36
==========================================
- Hits 12883 12859 -24
- Misses 4268 4310 +42
- Partials 1472 1490 +18
|
2c30f10
to
3ee9e7d
Compare
I am afraid that we must add integration test case for this pull request. @houstar 😄 |
OK. I'll update the unit test later |
972a144
to
1304f10
Compare
096436c
to
f61d2bc
Compare
@@ -122,7 +122,7 @@ type Resources struct { | |||
// Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. | |||
MemorySwap int64 `json:"MemorySwap"` | |||
|
|||
// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. | |||
// Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. -1 is also accepted, as a legacy alias of 0. |
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.
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.
yep...
Could you add some |
@allencloud OK. Will be update at tomorrow |
// Update the value
config.Cgroups.Resources.BlkioWeight = *r.BlockIO.Weight
config.Cgroups.Resources.CpuPeriod = *r.CPU.Period
config.Cgroups.Resources.CpuQuota = *r.CPU.Quota
config.Cgroups.Resources.CpuShares = *r.CPU.Shares
config.Cgroups.Resources.CpuRtPeriod = *r.CPU.RealtimePeriod
config.Cgroups.Resources.CpuRtRuntime = *r.CPU.RealtimeRuntime
config.Cgroups.Resources.CpusetCpus = r.CPU.Cpus
config.Cgroups.Resources.CpusetMems = r.CPU.Mems
config.Cgroups.Resources.KernelMemory = *r.Memory.Kernel
config.Cgroups.Resources.KernelMemoryTCP = *r.Memory.KernelTCP
config.Cgroups.Resources.Memory = *r.Memory.Limit
config.Cgroups.Resources.MemoryReservation = *r.Memory.Reservation
config.Cgroups.Resources.MemorySwap = *r.Memory.Swap
config.Cgroups.Resources.PidsLimit = r.Pids.Limit |
Yes, runc should update its resource.BlockIO. I'm coding in runc now and will push it in few days. |
ping @houstar |
Close this PR since this was resolved. |
Signed-off-by: Leno Hou lenohou@gmail.com
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fix #2509
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
To be added later
Ⅳ. Describe how to verify it
Create Container with:
#cat /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
8:0 104857600
Ⅴ. Special notes for reviews