Hey thereš
Is there a difference between limiting cpu consumption in swarm and not using swarm?
I feel that when we limit cpu consumption with swarm, a series of configurations are applied that are not applied in normal mode.
Share and learn in the Docker community.
Hey thereš
Is there a difference between limiting cpu consumption in swarm and not using swarm?
I feel that when we limit cpu consumption with swarm, a series of configurations are applied that are not applied in normal mode.
I donāt know, but what kind of differences did you notice?
For example, when I create a service with swarm, if that service reaches the maximum limited cpu consumption, there would be no problem, but now sometimes when I donāt use swarm, if a container reaches the limited maximum cpu consumption, sometimes It slows down and Docker commands donāt work.
I donāt use Swarm, so I donāt speak from experience when it comes to that, but when even docker commands slow down that means either your limits didnāt work at all, or the limits of all your services were bigger then the available resources on the machine. If Swarm doesnāt allow the machine to slow down when you run the same services with the same limits, it might have a feature which I donāt know about and which doesnāt let the containers use all the available resources. Without knowing the exact case, I can just guess, so letās wait until someone comes with more Swarm skills.
Swarm allows cpu reserve and limit. Docker just has a cpu limit. Both should work the same, except that plain docker canāt reserve the requested amount from the hostās cpu resources for that particular container.
Update: I was wrong about docker not supporting reservation of cpu resources. Both can use it. So please make sure when you compare both, that you use the same reserve and limit settings in both.
I would be surprised if this wouldnāt be handled on the runc level through cgroups. I assume docker just delegates the setting to containerd, which delegates it to runc.