mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 01:15:43 +03:00
changing the formula to correctly pass the CPUQota to docker
This commit is contained in:
@@ -1139,8 +1139,9 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas
|
||||
|
||||
// Calculate CPU Quota
|
||||
if driverConfig.CPUHardLimit {
|
||||
numCores := runtime.NumCPU()
|
||||
percentTicks := float64(task.Resources.CPU) / float64(d.node.Resources.CPU)
|
||||
hostConfig.CPUQuota = int64(percentTicks * defaultCFSPeriodUS)
|
||||
hostConfig.CPUQuota = int64(percentTicks*defaultCFSPeriodUS) * int64(numCores)
|
||||
}
|
||||
|
||||
// Windows does not support MemorySwap/MemorySwappiness #2193
|
||||
|
||||
Reference in New Issue
Block a user