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
In the Google Cloud console, go to the Memorystore for Valkey page.
Click your instance ID.
In the Configurations section, click the pencil icon next to Shards.
In the Shards field, enter the number of shards to which you want to scale your instance.
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
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
)
Check the output to see if the following conditions exist:
The output contains an
engineConfigs
section.The
maxmemory-clients
,maxmemory
, ormaxclients
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.
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
, andhighmem-xlarge
.
For this example, you scale the node type of the
my-instance
instance tohighmem-medium
. This instance is located in theus-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 to15,000
.gcloud memorystore instances update my-instance \ --location=us-central1 \ --node-type=highmem-medium \ --update-engine-configs=maxclients=15000