mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 23:38:24 +00:00
Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness behavior per container. For example, When a lower value of swappiness is chosen the container will see minimum major faults. When no value is specified for memory-swappiness in docker UI, it is inherited from parent cgroup. (generally 60 unless it is changed). Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
This commit is contained in:
@@ -13,9 +13,10 @@ type SysInfo struct {
|
||||
}
|
||||
|
||||
type cgroupMemInfo struct {
|
||||
MemoryLimit bool
|
||||
SwapLimit bool
|
||||
OomKillDisable bool
|
||||
MemoryLimit bool
|
||||
SwapLimit bool
|
||||
OomKillDisable bool
|
||||
MemorySwappiness bool
|
||||
}
|
||||
|
||||
type cgroupCpuInfo struct {
|
||||
|
||||
@@ -50,6 +50,10 @@ func checkCgroupMem(quiet bool) *cgroupMemInfo {
|
||||
if !quiet && !info.OomKillDisable {
|
||||
logrus.Warnf("Your kernel does not support oom control.")
|
||||
}
|
||||
info.MemorySwappiness = cgroupEnabled(mountPoint, "memory.swappiness")
|
||||
if !quiet && !info.MemorySwappiness {
|
||||
logrus.Warnf("Your kernel does not support memory swappiness.")
|
||||
}
|
||||
|
||||
return info
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user