-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscale.html.md.erb
58 lines (40 loc) · 1.85 KB
/
scale.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: Scale the App
owner: Daniel Freitag
---
<strong><%= modified_date %></strong>
Currently, your app is running as a single instance with 1 GB of memory.
You can check how many instances are running and how much memory they have using the `cf scale` command:
<pre class="terminal">
$ cf scale my-java-app
Showing current scale of app my-java-app in org MyOrg / space MySpace as user@mydomain.com...
OK
memory: 1G
disk: 1G
instances: 1
</pre>
By default, your app is deployed as one instance. Each instance runs in a separate container and gets the set amount of memory.
## Scaling Horizontally
Scaling an application horizontally on <%= vars.product_full %> is equivalent to changing the number of instances that are running. Scale the number of instances to 3:
<pre class="terminal">
$ cf scale my-java-app -i 3
Scaling app my-java-app in org MyOrg / space MySpace as user@mydomain.com...
OK
</pre>
## Scaling Vertically
Scaling an application vertically on <%= vars.product_full %> is equivalent to changing the amount of memory each instance has. Scale the amount of memory to 2 GB:
<pre class="terminal">
$ cf scale my-java-app -m 2G
This will cause the app to restart. Are you sure you want to scale my-java-app?> yes
Scaling app my-java-app in org MyOrg / space MySpace as user@mydomain.com...
OK
...
state since cpu memory disk details
#0 running 2016-05-29 03:38:11 PM 0.1% 326M of 2G 132.2M of 1G
#1 running 2016-05-29 03:38:11 PM 0.1% 326M of 2G 132.2M of 1G
#2 running 2016-05-29 03:38:11 PM 0.1% 326M of 2G 132.2M of 1G
</pre>
The last statement shows a summary of the three instances with a memory cap of 2 GB each that we now have.
<div style="text-align:center;margin:3em;">
<a href="./dependencies.html" class="btn btn-primary">I know how to scale my App</a>
</div>