-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscale.html.md.erb
67 lines (49 loc) · 2.1 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
59
60
61
62
63
64
65
66
67
---
title: Scale the App
owner: Tobias Fuhrimann
---
<strong><%= modified_date %></strong>
Currently, your app is running as a single instance with 64 MB 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-go-app
Showing current scale of app my-go-app in org MyOrg / space MySpace as user@mydomain.com...
OK
memory: 64M
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-go-app -i 3
Scaling app my-go-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 128 MB:
<pre class="terminal">
$ cf scale my-go-app -m 128M
This will cause the app to restart. Are you sure you want to scale my-go-app?> yes
Scaling app my-go-app in org MyOrg / space MySpace as user@mydomain.com...
OK
Stopping app my-go-app in org MyOrg / space MySpace as user@mydomain.com...
OK
...
requested state: started
instances: 3/3
usage: 128M x 3 instances
urls: my-random-hostname.scapp.io
last uploaded: Wed Apr 27 14:41:48 UTC 2016
stack: unknown
buildpack: binary_buildpack
state since cpu memory disk details
#0 running 2016-04-27 04:58:50 PM 0.0% 2.8M of 128M 7.6M of 1G
#1 running 2016-04-27 04:58:50 PM 0.0% 3M of 128M 7.6M of 1G
#2 running 2016-04-27 04:58:50 PM 0.0% 2.8M of 128M 7.6M of 1G
</pre>
The last statement shows a summary of the three instances with a memory cap of 128MB 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>