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

iis - ASP.Net Core CreatedAtAction in HttpPost action returns 201 but entire request ends with 500 -

gcc - Neither ld wrap nor LD_PRELOAD working to intercept system call -

ssh - Vagrant Windows - ssh_exchange_identification: read: Connection reset by peer -