Scale an instance

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

  1. In the Google Cloud console, go to the Clusters page.

    Go to Clusters

  2. Click a cluster in the Resource Name column.

  3. 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.

  4. Select a machine type.

  5. 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 RAM
    • 4: 4 vCPUs, 32 GB RAM
    • 8: 8 vCPUs, 64 GB RAM
    • 16: 16 vCPUs, 128 GB RAM
    • 32: 32 vCPUs, 256 GB RAM
    • 64: 64 vCPUs, 512 GB RAM
    • 96: 96 vCPUs, 768 GB RAM
    • 128: 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 a read pool instance's node count

Console

  1. In the Google Cloud console, go to the Clusters page.

    Go to Clusters

  2. Click a cluster in the Resource Name column.

  3. 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.

  4. 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.

  5. 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 number 1 through 20, 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.