This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
People using Kubernetes don't tune or change those settings, it's up to the app to behave properly.
Go, Containers, and the Linux Scheduler
11–20 of 143 posts
Re: Go, Containers, and the Linux Scheduler
#12Earlier quoted context omitted.
People using Kubernetes don't tune or change those settings, it's up to the app to behave properly.
False. Kubernetes cpu request sets the shares, cpu limit sets the cfs quota
If you set request / limit to 1 core but you run on 64 cores node , then you runtime will see that which will bring performance down.
Re: Go, Containers, and the Linux Scheduler
#13This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
I'll try and clarify this. I think this is how the sympton presents but I should be clearer.
Re: Go, Containers, and the Linux Scheduler
#14This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
One caveat is that an application can detect when --cpu is used as I think it's using cpuset. When quota are used it cannot detect and more threads than necessary will likely be spawned
Re: Go, Containers, and the Linux Scheduler
#15This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
> Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforcement. One caveat is that an application can detect when --cpu is used as I think it's using cpuset. When quota are used it cannot detect and more threads than necessary will likely be spawned
Re: Go, Containers, and the Linux Scheduler
#16I wondered for a while if docker could make a fake /proc/cpuinfo that apps could parse that just listed "docker cpus" allocated to the job, but upon further reflection, that probably wouldn't work for many reasons.
Re: Go, Containers, and the Linux Scheduler
#17This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
This is rather strong language without any real qualifiers. It is definitely not "mostly useless". Shares and quotas are for different use-cases, that's all. Understand your use-case and choose accordingly.
Re: Go, Containers, and the Linux Scheduler
#18Earlier quoted context omitted.
False. Kubernetes cpu request sets the shares, cpu limit sets the cfs quota
You said to change docker flags. Anyway your post is irrelevant, the goal is to let know the runtime about how many posix threads should it use. If you set request / limit to 1 core but you run on 64 cores node , then you runtime will see that which will bring performance down.
Re: Go, Containers, and the Linux Scheduler
#19This is subtly incorrect - as far as Docker is concerned CFS cgroup extension has several knobs to tune - cfs_quota_us, cfs_period_us (typical default is 100ms not a second) and shares. When you set shares you get weighted proportional scheduling (but only when there's contention). The former two enforce strict quota. Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforceme…
> Don't use Docker's --cpu flag and instead use --cpu-shares to avoid (mostly useless) quota enforcement. One caveat is that an application can detect when --cpu is used as I think it's using cpuset. When quota are used it cannot detect and more threads than necessary will likely be spawned
Re: Go, Containers, and the Linux Scheduler
#20Earlier quoted context omitted.
You said to change docker flags. Anyway your post is irrelevant, the goal is to let know the runtime about how many posix threads should it use. If you set request / limit to 1 core but you run on 64 cores node , then you runtime will see that which will bring performance down.
Original article is about docker. That’s the point of my comment - dont set cpu limit
I still believe it's best to set these variables regardless of cpu limits and/or cpu shares