Merge pull request #10100 from ndeloof/cpus

set CPU quota
This commit is contained in:
Guillaume Lours 2022-12-19 15:15:41 +01:00 committed by GitHub
commit 9d12eec148
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,
}