set CPU quota

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2022-12-19 14:59:31 +01:00
parent 1e682a40ac
commit d0e95ccac3
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
1 changed files with 2 additions and 1 deletions

View File

@ -529,7 +529,8 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
CPURealtimePeriod: s.CPURTPeriod,
CPURealtimeRuntime: s.CPURTRuntime,
CPUShares: s.CPUShares,
CPUPercent: int64(s.CPUS * 100),
NanoCPUs: int64(s.CPUS * 1e9),
CPUPercent: int64(s.CPUPercent * 100),
CpusetCpus: s.CPUSet,
DeviceCgroupRules: s.DeviceCgroupRules,
}