3 ms·
Do people here set CPU limits? (in either docker or kube) In my company we only set CPU requests + Memory req+limits. I read somewhere that CPU limits are kind
by jaimehrubiks 4y ago
Do people here set CPU limits? (in either docker or kube)
In my company we only set CPU requests + Memory req+limits. I read somewhere that CPU limits are kinda broken and are not reliable. In some experiments CPU limits tend to cause unnecessary throttling, which is why some people don't recommend them.
However, I've also found some cases where I can't make the app to use only some of the CPUs, some frameworks tend to read the number of total available CPUs on the node and try to use them.
- hu3 4y agoIn Windows dev machines, under wsl2, I always set CPU and RAM limits by creating a file in %USERPROFILE%/.wslconfig with something like: [wsl2] memory=10GB processors=4 swap=2GB By limiting wsl2 I also limit the docker containers that run inside wsl2.
- Mavvie 4y agoIn our k8s clusters we generally set both requests and limits on CPU and memory. We haven't noticed many problems, except for when some apps didn't even have CPU requests and dominated all the CPU on a cluster (which didn't even autoscale because the scheduler doesn't know about the problem). I think CPU limits (and also, choosing to set memory limits equal to the requests or higher) depends on your goal. If you want to get the best use out of your hardware, set low requests and high limits and you'll be able to minimize "wasted" scaling. But if your goal is consistent performance and availability, setting high requests and high limits (usually equal to each other) save you from a whole host of problems. Just my take. I have a fair bit of experience but am far from an expert on the topic. And my experience is only on the scale of dozens of applications/dozens of nodes...people with higher scale experience may feel differently.