Scale cluster capacity

This page describes how to scale a cluster in Memorystore for Redis Cluster. Your cluster's capacity is determined by the number of shards in your cluster and your cluster's node type. To scale your cluster, you must change the shard count or node type. For more information about a cluster's behavior during scaling, see About scaling cluster capacity.

Scale the shard count

You can increase or decrease the number of shards for a cluster by using either the Google Cloud console or Google Cloud CLI.

Console

  1. In the Google Cloud console, go to the Memorystore for Redis Cluster page.

    Memorystore for Redis Cluster

  2. Click your cluster ID.

  3. In the Configurations section, click the pencil icon next to Shards.

  4. In the Shards field, enter the number of shards to which you want to scale your cluster.

  5. Click Update cluster.

gcloud

To scale the number of shards for a cluster, use the gcloud redis clusters update command:

gcloud redis clusters update CLUSTER_ID \
--region=REGION_ID \
--shard-count=SHARD_COUNT

Replace the following:

  • CLUSTER_ID: the ID of your cluster.
  • REGION_ID: the region where your cluster is located.
  • SHARD_COUNT: the number of shards in your cluster. The shard count determines the total memory capacity for storing cluster data. For more information about cluster and node specifications for clusters, see Cluster and node specification.

For example:

gcloud redis clusters update my-cluster \
--region=us-central1 \
--shard-count=8

Scale the node type

You can scale the node type for a cluster by using the Google Cloud CLI.

gcloud

  1. To retrieve information about a cluster, use the gcloud redis clusters describe command:

    gcloud redis clusters describe CLUSTER_ID \
    --region=REGION_ID
    

    Replace the following:

    • CLUSTER_ID: the ID of your cluster
    • REGION_ID: the region where your cluster is located (for example, us-central1)
  2. Check the output to see if the following conditions exist:

    1. The output contains a redisConfigs section.

    2. The maxmemory-clients, maxmemory, or maxclients parameters appear in this section.

    If any of these parameters appear, then when you scale the node type for the cluster, you must scale the values for the parameters to reflect values that Memorystore for Redis Cluster can accept for the scaled node type. For more information, see Modifiable configuration parameters.

  3. To scale the node type, use the gcloud redis clusters update command:

    gcloud redis clusters update CLUSTER_ID \
    --region=REGION_ID \
    --node-type=NODE_TYPE
    

    Replace the following:

    • CLUSTER_ID: the ID of your cluster
    • REGION_ID: the region where your cluster is located
    • NODE_TYPE: the node type to which you want to scale your cluster

    For this example, you scale the node type of the my-cluster cluster to redis-highmem-medium. This cluster is located in the us-central1 region.

    gcloud redis clusters update my-cluster \
    --region=us-central1 \
    --node-type=redis-highmem-medium
    

    For this example, you change the value of the maxclients parameter to 15,000.

    gcloud redis clusters update my-cluster \
    --region=us-central1 \
    --node-type=redis-highmem-medium \
    --update-redis-config=maxclients=15000