Scaling your application servers
About scaling servers
You can scale your servers in two ways: horizontal and vertical. Horizontal scaling involves adding more servers, whereas vertical scaling involves altering the resources of a specific server, for example increasing the server size.
Horizontal scaling works differently for each server type and is only available if you have deployed using your cloud provider.
Kubernetes cluster servers
From your Application Overview, click on the
Servers tab to take you to your server groups page. To add a Kubernetes server, click the
+ sign in the top right corner of the server group, select your desired server size and quantity, and click Add. Your new server(s) will automatically be added to the cluster after they have completed provisioning and deployment, ready to serve traffic.
If you are using AWS, you will also have the option to scale your servers to different Availability Zones within your region using the
more option tab in the over-lay form.
You can also scale down your servers. From your Application Overview, click on the
Servers tab to take you to your server groups page, and click the
X icon next to the server you would like to scale down. This server will automatically be removed from your load balancer, and shutdown, but you will need to delete it from your cloud provider.
Your primary Kubernetes server cannot be scaled down, because this would leave you without a server.
To scale up a service in a Maestro app via the Dashboard:
- Log into your Cloud 66 Dashboard
- In the Services panel, click on the edit icon in the same row as the service you want to scale
- A panel will slide in from the left. Update the Desired Count field to the number you require
- Click Save Service (this will close the panel)
- Click the update icon (to the left of the Instances column) and then click Apply in the panel to immediately update that service
If you need to scale multiple services simultaneously:
- Follow steps 1 to 4 above for each of the services
- Click the green Apply button in the yellow bar above the Services panel to apply all your service changes to your cluster
Scaling services with Toolbelt (cx)
You can scale your service entirely via your command line Toolbelt. The operative command is:
cx services scale <service_name> <count>
<count> containers of the given service across the stack.
<count> is an absolute value like
2, then there will be a total of
<count> containers across the stack.
<count> is a relative value like
[-3], then the current total count of containers across the stack will be changed by
The following command sets
my_web_service to use 5 containers:
cx service scale -s my_app my_web_service 5
The following command adds 2 more
image_processor containers to your cluster:
cx service scale -s my_app image_processor [+2]
The following command removes one
my_web_service container from your cluster:
cx service scale -s my_app my_web_service [-1]
The container/pod distribution is handled by Kuberntes controller and as a result it is not guaranteed that your container/pod is distributed evenly i.e you may sometimes find one server with multiple of the same containers/pods and one with zero container/pod of the same service.
You can scale your database servers through database replication, or Elasticsearch through sharding. See our database management section for more information.