1
Title: Scaling - OpenStack
8
Whereas traditional applications required larger hardware to scale ("vertical scaling"),
9
cloud-based applications typically request more, discrete hardware ("horizontal scaling").
10
If your cloud is successful, eventually you must add resources to meet the increasing
13
To suit the cloud paradigm, OpenStack itself is designed to be horizontally scalable.
14
Rather than switching to larger servers, you procure more servers and simply install
15
identically configured services. Ideally, you scale out and load balance among groups
16
of functionally identical services.
18
But to scale the services running on OpenStack sometimes even OpenStack itself has to
19
be scaled. This means nodes for computing or storage have to be added.
29
To list the hosts and the nova-related services that run on them call
33
+------------------+-------------+----------+
34
| host_name | service | zone |
35
+------------------+-------------+----------+
36
| devstack-grizzly | conductor | internal |
37
| devstack-grizzly | compute | nova |
38
| devstack-grizzly | cert | internal |
39
| devstack-grizzly | network | internal |
40
| devstack-grizzly | scheduler | internal |
41
| devstack-grizzly | consoleauth | internal |
42
+------------------+-------------+----------+
45
To get a summary of resource usage of all of the instances running on the host call
48
$ nova host-describe devstack-grizzly
49
+------------------+----------------------------------+-----+-----------+---------+
50
| HOST | PROJECT | cpu | memory_mb | disk_gb |
51
+------------------+----------------------------------+-----+-----------+---------+
52
| devstack-grizzly | (total) | 2 | 4003 | 157 |
53
| devstack-grizzly | (used_now) | 3 | 5120 | 40 |
54
| devstack-grizzly | (used_max) | 3 | 4608 | 40 |
55
| devstack-grizzly | b70d90d65e464582b6b2161cf3603ced | 1 | 512 | 0 |
56
| devstack-grizzly | 66265572db174a7aa66eba661f58eb9e | 2 | 4096 | 40 |
57
+------------------+----------------------------------+-----+-----------+---------+
60
These information help you understand how this host is used.
62
- The `cpu` column shows the sum of the virtual CPUs for instances running on the host.
63
- The `memory_mb` column shows the sum of the memory (in MB) allocated to the instances
64
that run on the hosts.
65
- The `disk_gb` column shows the sum of the root and ephemeral disk sizes (in GB) of
66
the instances that run on the hosts.
67
- The `used_now` row shows the sum of the resources allocated to the instances that run
68
on the host plus the resources allocated to the virtual machine of the host itself.
69
- The `used_max` row shows the sum of the resources allocated to the instances that run
72
**Note:** These values are computed by using only information about the flavors of the
73
instances that run on the hosts. This command does not query the CPU usage, memory usage,
74
or hard disk usage of the physical host.
76
Now you an retrieve the CPU, memory, I/O, and network statistics for an instance. First
81
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
82
| ID | Name | Status | Task State | Power State | Networks |
83
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
84
| 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 | myCirrosServer | ACTIVE | None | Running | private=10.0.0.3 |
85
| 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None | Running | private=10.0.0.4 |
86
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
89
Then, get diagnostic statistics:
92
$ nova diagnostics myCirrosServer
93
+------------------+----------------+
95
+------------------+----------------+
96
| vnet1_rx | 1210744 |
97
| cpu0_time | 19624610000000 |
100
| vda_write_req | 0 |
101
| vnet1_tx | 863734 |
102
| vnet1_tx_errors | 0 |
103
| vnet1_rx_drop | 0 |
104
| vnet1_tx_packets | 3855 |
105
| vnet1_tx_drop | 0 |
106
| vnet1_rx_errors | 0 |
108
| vnet1_rx_packets | 5485 |
111
+------------------+----------------+
114
Finally you can get summary statistics for each tenant.
118
Usage from 2013-06-25 to 2013-07-24:
119
+----------------------------------+-----------+--------------+-----------+---------------+
120
| Tenant ID | Instances | RAM MB-Hours | CPU Hours | Disk GB-Hours |
121
+----------------------------------+-----------+--------------+-----------+---------------+
122
| b70d90d65e464582b6b2161cf3603ced | 1 | 344064.44 | 672.00 | 0.00 |
123
| 66265572db174a7aa66eba661f58eb9e | 3 | 671626.76 | 327.94 | 6558.86 |
124
+----------------------------------+-----------+--------------+-----------+---------------+
127
**TODO** How to interpret this information to know when to scale?
131
Adding compute nodes is straightforward. They are easily picked up by the existing
132
installation. Simply call
135
juju add-unit nova-compute