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
Post a Comment