Scale the number of replicas

This page explains how to scale the number of replicas for an instance.

Scaling and two-zone deployments

If a zone experiences resource constraints when you scale an instance by adding replicas to the instance, then Memorystore for Valkey automatically deploys the instance across two zones. This deployment ensures that your instance scales successfully. For more information about this type of deployment, see Two-zone deployments for high availability and resilience.

Update the number of replicas

You can scale an instance by updating its number of replicas.

Console

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

    Memorystore for Valkey

  2. Click the ID of the instance that you want to scale.

  3. Scroll to the Configurations section.

  4. Next to the Replicas per shard field, click Edit replica count ().

  5. From the Replicas menu, select the number of replicas that you want for the instance. You can select 0-5 replicas per shard.

  6. Click Update instance.

gcloud

To update the number of replicas, use the gcloud memorystore instances update command:

gcloud memorystore instances update INSTANCE_ID \
  --location=REGION_ID \
  --replica-count=REPLICA_COUNT

Make the following replacements:

  • INSTANCE_ID: the ID of the instance.
  • REGION_ID: the region where the instance is located.
  • REPLICA_COUNT: the number of replicas (per shard) that you want for the instance. Acceptable values are 0-5.