github.com/kim0/docker@v0.6.2-0.20161130212042-4addda3f07e7/docs/reference/commandline/service_scale.md (about)

     1  ---
     2  title: "service scale"
     3  description: "The service scale command description and usage"
     4  keywords: ["service, scale"]
     5  ---
     6  
     7  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # service scale
    17  
    18  ```markdown
    19  Usage:  docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
    20  
    21  Scale one or multiple services
    22  
    23  Options:
    24        --help   Print usage
    25  ```
    26  
    27  ## Examples
    28  
    29  ### Scale a service
    30  
    31  The scale command enables you to scale one or more services either up or down to
    32  the desired number of replicas. The command will return immediately, but the
    33  actual scaling of the service may take some time. To stop all replicas of a
    34  service while keeping the service active in the swarm you can set the scale to 0.
    35  
    36  For example, the following command scales the "frontend" service to 50 tasks.
    37  
    38  ```bash
    39  $ docker service scale frontend=50
    40  frontend scaled to 50
    41  ```
    42  
    43  Directly afterwards, run `docker service ls`, to see the actual number of
    44  replicas.
    45  
    46  ```bash
    47  $ docker service ls --filter name=frontend
    48  
    49  ID            NAME      REPLICAS  IMAGE         COMMAND
    50  3pr5mlvu3fh9  frontend  15/50     nginx:alpine
    51  ```
    52  
    53  You can also scale a service using the [`docker service update`](service_update.md)
    54  command. The following commands are equivalent:
    55  
    56  ```bash
    57  $ docker service scale frontend=50
    58  $ docker service update --replicas=50 frontend
    59  ```
    60  
    61  ### Scale multiple services
    62  
    63  The `docker service scale` command allows you to set the desired number of
    64  tasks for multiple services at once. The following example scales both the
    65  backend and frontend services:
    66  
    67  ```bash
    68  $ docker service scale backend=3 frontend=5
    69  backend scaled to 3
    70  frontend scaled to 5
    71  
    72  $ docker service ls
    73  ID            NAME      REPLICAS  IMAGE         COMMAND
    74  3pr5mlvu3fh9  frontend  5/5       nginx:alpine
    75  74nzcxxjv6fq  backend   3/3       redis:3.0.6
    76  ```
    77  
    78  ## Related information
    79  
    80  * [service create](service_create.md)
    81  * [service inspect](service_inspect.md)
    82  * [service ls](service_ls.md)
    83  * [service rm](service_rm.md)
    84  * [service ps](service_ps.md)
    85  * [service update](service_update.md)