github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/docs/reference/commandline/service_scale.md (about) 1 <!--[metadata]> 2 +++ 3 title = "service scale" 4 description = "The service scale command description and usage" 5 keywords = ["service, scale"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 # service scale 12 13 ```markdown 14 Usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...] 15 16 Scale one or multiple services 17 18 Options: 19 --help Print usage 20 ``` 21 22 ## Examples 23 24 ### Scale a service 25 26 If you scale a service, you set the *desired* number of replicas. Even though 27 the command returns directly, actual scaling of the service may take some time. 28 29 For example, the following command scales the "frontend" service to 50 tasks. 30 31 ```bash 32 $ docker service scale frontend=50 33 frontend scaled to 50 34 ``` 35 36 Directly afterwards, run `docker service ls`, to see the actual number of 37 replicas 38 39 ```bash 40 $ docker service ls --filter name=frontend 41 42 ID NAME REPLICAS IMAGE COMMAND 43 3pr5mlvu3fh9 frontend 15/50 nginx:alpine 44 ``` 45 46 You can also scale a service using the [`docker service update`](service_update.md) 47 command. The following commands are therefore equivalent: 48 49 ```bash 50 $ docker service scale frontend=50 51 $ docker service update --replicas=50 frontend 52 ``` 53 54 ### Scale multiple services 55 56 The `docker service scale` command allows you to set the desired number of 57 tasks for multiple services at once. The following example scales both the 58 backend and frontend services: 59 60 ```bash 61 $ docker service scale backend=3 frontend=5 62 backend scaled to 3 63 frontend scaled to 5 64 65 $ docker service ls 66 ID NAME REPLICAS IMAGE COMMAND 67 3pr5mlvu3fh9 frontend 5/5 nginx:alpine 68 74nzcxxjv6fq backend 3/3 redis:3.0.6 69 ``` 70 71 ## Related information 72 73 * [service create](service_create.md) 74 * [service inspect](service_inspect.md) 75 * [service ls](service_ls.md) 76 * [service rm](service_rm.md) 77 * [service ps](service_ps.md) 78 * [service update](service_update.md)