|
1 | 1 | # Managing an Application |
2 | 2 |
|
3 | | -## Scale the Application |
4 | | - |
5 | | -Applications deployed on Deis [scale out via the process model][]. |
6 | | -Use `deis scale` to control the number of [Containers][container] that power your app. |
7 | | - |
8 | | - $ deis scale web=8 |
9 | | - Scaling processes... but first, coffee! |
10 | | - done in 20s |
11 | | - |
12 | | - === peachy-waxworks Processes |
13 | | - |
14 | | - --- web: |
15 | | - web.1 up (v2) |
16 | | - web.2 up (v2) |
17 | | - web.3 up (v2) |
18 | | - web.4 up (v2) |
19 | | - web.5 up (v2) |
20 | | - web.6 up (v2) |
21 | | - web.7 up (v2) |
22 | | - web.8 up (v2) |
23 | | - |
24 | | -Scaling is managed by process types like `web` or `worker` defined in a |
25 | | -[Procfile][] in the root of your application repository. |
| 3 | +## Scaling an Application |
| 4 | + |
| 5 | +Applications deployed on Deis [scale out via the process model][]. Use `deis scale` to control the number of |
| 6 | +[Containers][container] that power your app. |
| 7 | + |
| 8 | +``` |
| 9 | +$ deis scale cmd=5 -a iciest-waggoner |
| 10 | +Scaling processes... but first, coffee! |
| 11 | +done in 3s |
| 12 | +=== iciest-waggoner Processes |
| 13 | +--- cmd: |
| 14 | +iciest-waggoner-v2-cmd-09j0o up (v2) |
| 15 | +iciest-waggoner-v2-cmd-3r7kp up (v2) |
| 16 | +iciest-waggoner-v2-cmd-gc4xv up (v2) |
| 17 | +iciest-waggoner-v2-cmd-lviwo up (v2) |
| 18 | +iciest-waggoner-v2-cmd-kt7vu up (v2) |
| 19 | +``` |
| 20 | + |
| 21 | +If you have multiple process types for your application you may scale the process count for each type separately. For |
| 22 | +example, this allows you to manage web process indepenetly from background workers. For more information on process |
| 23 | +types see our documentation for [Managing App Processes](managing-app-processes.md). |
| 24 | + |
| 25 | +In this example, we are scaling the process type `web` to 5 but leaving the process type `background` with one worker. |
| 26 | + |
| 27 | +``` |
| 28 | +$ deis scale web=5 |
| 29 | +Scaling processes... but first, coffee! |
| 30 | +done in 4s |
| 31 | +=== scenic-icehouse Processes |
| 32 | +--- web: |
| 33 | +scenic-icehouse-v2-web-7lord up (v2) |
| 34 | +scenic-icehouse-v2-web-jn957 up (v2) |
| 35 | +scenic-icehouse-v2-web-rsekj up (v2) |
| 36 | +scenic-icehouse-v2-web-vwhnh up (v2) |
| 37 | +scenic-icehouse-v2-web-vokg7 up (v2) |
| 38 | +--- background: |
| 39 | +scenic-icehouse-v2-background-yf8kh up (v2) |
| 40 | +``` |
26 | 41 |
|
27 | 42 | !!! note |
28 | | - Docker applications can use the `cmd` process type to scale the default container command. |
| 43 | + The default process type for Dockerfile and Docker Image applications is 'cmd' rather than 'web'. |
| 44 | + |
| 45 | +Scaling a process down, by reducing the process count, sends a `TERM` signal to the processes, followed by a `SIGKILL` |
| 46 | +if they have not exited within 30 seconds. Depending on your application, scaling down may interrupt long-running HTTP |
| 47 | +client connections. |
| 48 | + |
| 49 | +For example, scaling from 5 processes to 3: |
| 50 | + |
| 51 | +``` |
| 52 | +$ deis scale web=3 |
| 53 | +Scaling processes... but first, coffee! |
| 54 | +done in 1s |
| 55 | +=== scenic-icehouse Processes |
| 56 | +--- background: |
| 57 | +scenic-icehouse-v2-background-yf8kh up (v2) |
| 58 | +--- web: |
| 59 | +scenic-icehouse-v2-web-7lord up (v2) |
| 60 | +scenic-icehouse-v2-web-rsekj up (v2) |
| 61 | +scenic-icehouse-v2-web-vokg7 up (v2) |
| 62 | +``` |
| 63 | + |
| 64 | +## Restarting an Application Processes |
| 65 | + |
| 66 | +If you need to restart an application process, you may use `deis ps:restart`. Behind the scenes, Deis Workflow instructs |
| 67 | +Kubernetes to terminate the old process and launch a new one in its place. |
| 68 | + |
| 69 | +``` |
| 70 | +$ deis ps |
| 71 | +=== scenic-icehouse Processes |
| 72 | +--- web: |
| 73 | +scenic-icehouse-v2-web-7lord up (v2) |
| 74 | +scenic-icehouse-v2-web-rsekj up (v2) |
| 75 | +scenic-icehouse-v2-web-vokg7 up (v2) |
| 76 | +--- background: |
| 77 | +scenic-icehouse-v2-background-yf8kh up (v2) |
| 78 | +$ deis ps:restart scenic-icehouse-v2-background-yf8kh |
| 79 | +Restarting processes... but first, coffee! |
| 80 | +done in 6s |
| 81 | +=== scenic-icehouse Processes |
| 82 | +--- background: |
| 83 | +scenic-icehouse-v2-background-yd87g up (v2) |
| 84 | +``` |
| 85 | + |
| 86 | +Notice that the process name has changed from `scenic-icehouse-v2-background-yf8kh` to |
| 87 | +`scenic-icehouse-v2-background-yd87g`. In a multi-node Kubernetes cluster, this may also have the effect of scheduling |
| 88 | +the Pod to a new node. |
29 | 89 |
|
30 | 90 | ## Rollback a Release |
31 | 91 |
|
|
0 commit comments