docker - Do --limit-xxx options of service command limit resource per service or per container? -


service create command of docker 1.12 has 2 options limit cpu , memory follows:

  --limit-cpu value              limit cpus (default 0.000)   --limit-memory value           limit memory (default 0 b) 

do limit resource per service or per container?

you can see in api/client/service/update.go

taskresources().limits = &swarm.resources{} updateint64value(flaglimitcpu, &task.resources.limits.nanocpus) 

--limit-cpu introduced in commit 12a00e6

considering swarmkit/manager/scheduler/nodeinfo.go has, when removing task, following code:

nodeinfo.availableresources.nanocpus += reservations.nanocpus 

it appears limit-cpu per node managed service.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -