Scale instance capacity

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

Scale the shard count

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

Console

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

    Memorystore for Valkey

  2. Click your instance 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 instance.

  5. Click Update instance.

gcloud

To scale the number of shards for an instance, use the gcloud memorystore instances update command:

gcloud memorystore instances update INSTANCE_ID \
--location=REGION_ID \
--shard-count=SHARD_COUNT

Replace the following:

  • INSTANCE_ID: the ID of your instance.
  • REGION_ID: the region where your instance is located.
  • SHARD_COUNT: the number of shards in your instance. The shard count determines the total memory capacity for storing instance data. For more information about instance and node specifications for Memorystore for Valkey instances, see Instance and node specification.

For example:

gcloud memorystore instances update my-instance \
--location=us-central1 \
--shard-count=8

Scale the node type

You can scale the node type for an instance by using the Google Cloud CLI.

gcloud

  1. To retrieve information about an instance, use the gcloud memorystore instances describe command:

    gcloud memorystore instances describe INSTANCE_ID \
    --location=REGION_ID
    

    Replace the following:

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

    1. The output contains an engineConfigs 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 instance, you must scale the values for the parameters to reflect values that Memorystore for Valkey can accept for the scaled node type. For more information, see Modifiable configuration parameters.

  3. To scale the node type, use the gcloud memorystore instances update command:

    gcloud memorystore instances update INSTANCE_ID \
    --location=REGION_ID \
    --node-type=NODE_TYPE
    

    Replace the following:

    • INSTANCE_ID: the ID of your instance.
    • REGION_ID: the region where your instance is located.
    • NODE_TYPE: the node type to which you want to scale your instance. Acceptable values for this parameter are shared-core-nano, standard-small, highmem-medium, and highmem-xlarge.

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

    gcloud memorystore instances update my-instance \
    --location=us-central1 \
    --node-type=highmem-medium
    

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

    gcloud memorystore instances update my-instance \
    --location=us-central1 \
    --node-type=highmem-medium \
    --update-engine-configs=maxclients=15000