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

    Go to Clusters

  2. Click a cluster in the Resource Namecolumn.

  3. On the Overviewpage, go to the Instances in your clustersection, and click Edit primaryor Edit read pool.

    Note that this action is not available if the page reports a cluster Statusof Maintenance. The action becomes available again after Statuschanges to Ready.

  4. Select one of the following machine series:

    • C4A (Google Axion-based machine series) ( Preview )
    • N2 (x86-based machine series). This is the default machine series.
  5. Select a machine type.

    • C4A supports 1, 4, 8, 16, 32, 48, 64, and 72 machine types or shapes.
    • N2 supports 2,4,8,16,32,64,96, and 128 machine types or shapes.

      For more information about using the C4A Axion-based machine series, including the 1 vCPU machine type, see Considerations when using the C4A Axion-based machine series .

  6. Click Update instanceor 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 
  
 \ 
--machine-type = 
 MACHINE_TYPE 
  
 \ 
--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 N2 vCPUs that you want for the instance. N2 is the default. Valid values include the following:

    • 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
  • MACHINE_TYPE : This parameter is optional when you deploy N2 machines. To deploy the C4A Axion-based machine series ( Preview ), or to migrate between C4A and N2 machines, choose this parameter with the following values.

    When you use MACHINE_TYPE and CPU_COUNT together, the values in CPU_COUNT and MACHINE_TYPE must match, otherwise you get an error.

    For the C4A Axion-based machine series, choose the machine type with following values:

    • c4a-highmem-1
    • c4a-highmem-4-lssd
    • c4a-highmem-8-lssd
    • c4a-highmem-16-lssd
    • c4a-highmem-32-lssd
    • c4a-highmem-48-lssd
    • c4a-highmem-64-lssd
    • c4a-highmem-72-lssd

    To deploy C4A with 4 vCPU and higher, use the suffix lssd , to enable ultra fast cache.

    For more information about using the C4A Axion-based machine series, including the 1 vCPU machine type, see Considerations when using the C4A Axion-based machine series .

    For the N2 x86-based machine series, use the following values:

    • N2-highmem-2
    • N2-highmem-4
    • N2-highmem-8
    • N2-highmem-16
    • N2-highmem-32
    • N2-highmem-64
    • N2-highmem-96
    • N2-highmem-128
  • 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 .

Accelerate machine type updates

To update the machine type faster, use the FORCE_APPLY option with the gcloud beta alloydb instances update command.

   
gcloud  
beta  
alloydb  
instances  
update  
 INSTANCE_ID 
  
 \ 
  
--cpu-count = 
 CPU_COUNT 
  
 \ 
  
--machine-type = 
 MACHINE_TYPE 
  
 \ 
  
--region = 
 REGION_ID 
  
 \ 
  
--cluster = 
 CLUSTER_ID 
  
 \ 
  
--project = 
 PROJECT_ID 
  
--update-mode = 
FORCE_APPLY 
  • The instance experiences approximately one minute of downtime.

  • The machine type of an instance changes after 10 to 15 minutes.

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

  1. In the Google Cloud console, go to the Clusterspage.

    Go to Clusters

  2. Click a cluster in the Resource Namecolumn.

  3. On the Overviewpage, go to the Instances in your clustersection, and click Edit read pool.

    Note that this action is not available if the page reports a cluster Statusof Maintenance. The action becomes available again after Statuschanges to Ready.

  4. In the Node countfield, 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 .

Create a Mobile Website
View Site in Mobile | Classic
Share by: