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

## 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](https://console.cloud.google.com/memorystore/valkey/instances)
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`](https://docs.cloud.google.com/sdk/gcloud/reference/memorystore/instances/update.md.txt) command:

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

Make the following replacements:

- <var translate="no">INSTANCE_ID</var>: the ID of the instance.
- <var translate="no">REGION_ID</var>: the region where the instance is located.
- <var translate="no">REPLICA_COUNT</var>: the number of replicas (per shard) that you want for the instance. Acceptable values are `0`-`5`.