docker service update --limit-cpu 0.5 --limit-memory 512M web

Category: Docker

docker service update --limit-cpu 0.5 --limit-memory 512M web

Cap CPU and memory for a service

Limits each task to half a CPU and 512 MB of memory; exceeding memory kills the task. Limits apply per task, not per service. Reserve values guarantee capacity with --reserve-cpu and --reserve-memory.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.