k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.04k stars 2.35k forks source link

Configurable cpuCFSQuotaPeriod settings for K3s #2815

Closed gerricchaplin closed 3 years ago

gerricchaplin commented 3 years ago

Is your feature request related to a problem? Please describe. Hi,

I might come up short and get told this can be done easily somewhere but I have not come across a way to configure cpuCFSQuotaPeriod for K3s - so that I can decrease the default period of 100ms to match my larger full-blown Kubernetes clusters and decrease throttling.

Describe the solution you'd like I would like a flag which can be set via the command line so that I can lower or increase the cpuCFSQuotaPeriod as I see fit. cpu-cfs-quota-period=<period in ms>

Describe alternatives you've considered I don't think there is much in the way of alternatives unless I disable the quote altogether which I also do not see any way to accomplish. cpu-cfs-quota=false

Additional context Monzo, Zolando and others have done a good job of covering this topic already. I'm not sure I need to add more but being able to disable quotas and or decrease the quota periods can bring some performance gains and ensure much better usage of CPU time.

I guess that may mean supporting the CustomCPUCFSQuotaPeriod flag too?

brandond commented 3 years ago

It looks like this is just a kubelet argument? You can pass those through to agent and server nodes as --kubelet-arg=cpu-cfs-quota-period=100ms.

https://rancher.com/docs/k3s/latest/en/installation/install-options/agent-config/#customized-flags

gerricchaplin commented 3 years ago

Thanks for the quick reply! I thought it might be the case, but I was not sure if this was in any way limited? Should I be able to pass in any core kubelet arguments that match to the same version of k8s?

brandond commented 3 years ago

Yes, you can pass through arbitrary args to kubelet, kube-apiserver, etc and they are not validated by k3s. That's what it's for.

gerricchaplin commented 3 years ago

Excellent! Thanks again for the help!