This page shows how to scale an AlloyDB instance. You can scale both primary and read pool instances vertically by changing the instance's machine type, and you can scale read pool instances horizontally by changing the number of nodes in the instance.
Before you begin
- The Google Cloud project you are using must have been enabled to access AlloyDB.
- You must have one of these IAM roles in the Google Cloud project you are using:
roles/alloydb.admin
(the AlloyDB Admin predefined IAM role)roles/owner
(the Owner basic IAM role)roles/editor
(the Editor basic IAM role)
If you don't have any of these roles, contact your Organization Administrator to request access.
Scale an instance's machine type
Console
In the Google Cloud console, go to the Clusters page.
Click a cluster in the Resource Name column.
On the Overview page, go to the Instances in your cluster section, and click Edit primary or Edit read pool.
Note that this action is not available if the page reports a cluster Status of Maintenance. The action becomes available again after Status changes to Ready.
Select a machine type.
Click Update instance or Update read pool.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
Use the gcloud alloydb instances
update
command to change the machine type of the primary instance.
gcloud alloydb instances update INSTANCE_ID \
--cpu-count=CPU_COUNT \
--region=REGION_ID \
--cluster=CLUSTER_ID \
--project=PROJECT_ID
Replace the following:
INSTANCE_ID
: The ID of the instance that you are updating.CPU_COUNT
: The number of vCPUs you want for the instance. Valid values include:2
: 2 vCPUs, 16 GB RAM4
: 4 vCPUs, 32 GB RAM8
: 8 vCPUs, 64 GB RAM16
: 16 vCPUs, 128 GB RAM32
: 32 vCPUs, 256 GB RAM64
: 64 vCPUs, 512 GB RAM96
: 96 vCPUs, 768 GB RAM128
: 128 vCPUs, 864 GB RAM
REGION_ID
: The region where the instance is placed.CLUSTER_ID
: The ID of the cluster where the instance is placed.PROJECT_ID
: The ID of the project where the cluster is placed.
If the command returns an error message that includes the phrase
invalid cluster state MAINTENANCE
, then the cluster is undergoing
routine maintenance. This temporarily disallows instance reconfiguration.
Run the command again after the cluster returns to a READY
state.
To check on the cluster's status, see View cluster
details.
Scale the node count of a read pool instance
AlloyDB lets you scale the number of nodes in a read pool instance without any downtime at the instance level. When you increase the node count, client connections remain unaffected.
When you decrease the node count, any clients connected to a node that's being shut down can reconnect to the other nodes using the instance endpoint.
Console
In the Google Cloud console, go to the Clusters page.
Click a cluster in the Resource Name column.
On the Overview page, go to the Instances in your cluster section, and click Edit read pool.
Note that this action is not available if the page reports a cluster Status of Maintenance. The action becomes available again after Status changes to Ready.
In the Node count field, enter a node count. Note: You can have a maximum of 20 nodes across all the read pool instances in a cluster.
Click Update read pool.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
Use the gcloud alloydb instances
update
command to change the
number of nodes in a read pool instance.
gcloud alloydb instances update INSTANCE_ID \
--read-pool-node-count=NODE_COUNT \
--region=REGION_ID \
--cluster=CLUSTER_ID \
--project=PROJECT_ID
INSTANCE_ID
: The ID of the read pool instance.NODE_COUNT
: The number of nodes in the read pool instance. Specify a number1
through20
, inclusive. Note that you cannot have more than 20 nodes across all read pool instances in a cluster.REGION_ID:
The region where the instance is placed.CLUSTER_ID
: The ID of the cluster where the instance is placed.PROJECT_ID
: The ID of the project where the cluster is placed.
If the command returns an error message that includes the phrase
invalid cluster state MAINTENANCE
, then the cluster is undergoing
routine maintenance. This temporarily disallows instance reconfiguration.
Run the command again after the cluster returns to a READY
state. To
check on the cluster's status, see View cluster
details.