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

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.

Note:

Your primary Kubernetes server cannot be scaled down, because this would leave you without a server.

Scaling services

To scale up a service in a Maestro app via the Dashboard:

  1. Log into your Cloud 66 Dashboard
  2. In the Services panel, click on the edit icon in the same row as the service you want to scale
  3. A panel will slide in from the left. Update the Desired Count field to the number you require
  4. Click Save Service (this will close the panel)
  5. 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:

  1. Follow steps 1 to 4 above for each of the services
  2. Click the green Apply button in the yellow bar above the Services panel to apply all your service changes to your cluster

How to scale services in the dashboard

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>

Starts <count> containers of the given service across the stack. If <count> is an absolute value like 2, then there will be a total of <count> containers across the stack.

If <count> is a relative value like [+2] or [-3], then the current total count of containers across the stack will be changed by <count>.

Note:

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.

Database servers

You can scale your database servers through database replication, or Elasticsearch through sharding. See our database management section for more information.