Scaling a Database Cluster
Managed Databases service allows you to increase or decrease the number of replicas in the cluster, as well as change the server configuration to provide better performance of the database cluster.
Changing the Configuration of Servers in a Cluster
Follow these steps to change the configuration of the cluster servers:
- Go to the cluster settings page.
- Click Scale cluster.
Select the required fixed or custom configuration.
Please note that you can only choose configurations with a larger disk space. vCPU and RAM can be either decreased or increased.
Save your changes.
The cluster status will change to RESIZING. The time that the cluster will remain in this status depends on the amount of data in the cluster.
Scaling process will vary depending on the number of replicas in the cluster.
If there are no replicas in the cluster (the cluster consists only of the master), then the master will be stopped to apply the changes. Because of this, the cluster will be temporarily unavailable for read and write. After applying the changes, the master will start and the cluster will be available again.
If there are replicas in the cluster, scaling process will not affect its operation — the cluster will be available for read and write while applying changes. For a cluster with replicas, the configuration change will look as follows:
- first, the replicas will be stopped one by one, and their configurations will be changed;
- after all replicas are scaled, the master will switch to a synchronous replica;
- lastly, the “former master” will be scaled.
After successfully applying the changes, the cluster status will change to ACTIVE. If you previously changed the DBMS settings, then they may change after scaling the cluster. Learn more in the PostgreSQL Settings instructions.
Changing the Number of Replicas
The presence of replicas in a cluster affects its fault tolerance. We recommend creating fault tolerant clusters consisting of the master and replicas.
Follow these steps to change the number of replicas in a cluster:
- Click Scale cluster on the cluster settings page.
Select the required number of replicas.
Please note that each new replica takes a new address in the subnet. You cannot add replicas to the cluster if there are no free addresses on the subnet that the cluster is connected to.
Save your changes.
The cluster status will change to RESIZING. The cluster still will be available in this status.
After the operation is completed, the cluster status will change to ACTIVE.