Memorystore for Valkey supports a subset of the OSS Valkey configuration parameters that you can modify to customize the behavior of your instance.
Configuration changes don't require a restart of the instance, and are saved if the instance restarts. You can update the modifiable configuration parameters after creating an instance.
For more information about the modifiable configuration parameters, see Supported instance configurations.
Before you begin
Ensure that you have installed the latest version of the Google Cloud CLI
by running gcloud components update
.
View configuration parameters
To view configuration parameters using the Google Cloud CLI, run the
gcloud memorystore instances describe
command, replacing variables with
appropriate values.
You can't see configuration parameters when running the
gcloud memorystore instances describe
command unless you change a configuration
parameter from its default value.
gcloud memorystore instances describe instance-id --location=region-id
Example:
gcloud memorystore instances describe my-instance --location=us-central1
Set a configuration parameter during instance creation
To set a configuration parameter while creating an instance, run the
gcloud memorystore instances create
command with --engine-configs
flag, replacing
variables with appropriate values.
gcloud memorystore instances create instance-id \ --location=region-id \ --project=project-id \ --node-type=node-type \ --shard-count=shard-count \ --mode=MODE --engine-configs=config-name=config-value \
Replace the following:
- instance-id is the ID of the Memorystore for Valkey instance you're creating.
- region-id is the region where you want the instance placed.
- project-id is your project ID.
node-type is your chosen node type. Accepted values are:
shared-core-nano
standard-small
highmem-medium
highmem-xlarge
For more details on node types and instance configurations, see Instance and node specification.
shard-count determines the number of shards in your instance. Shard count determines the total memory capacity for storing instance data. If the mode that you select is Cluster Mode Disabled, then you can specify only one shard for your instance. For more information, see Instance and node specification.
mode determines if the instance is Cluster Mode Enabled or Cluster Mode Disabled. If this field is omitted, then the instance defaults to Cluster Mode Enabled. For more information, see Enable and disable Cluster Mode.
config-name is the configuration parameter to modify.
config-value is your chosen setting corresponding to the parameter you're configuring.
For example:
Cluster Mode Enabled example
gcloud memorystore instances create foo --location=us-east1 --project=test-proj --node-type=highmem-medium --shard-count=3 --engine-configs=maxmemory-policy=allkeys-lru
Cluster Mode Disabled example
gcloud memorystore instances create foo --location=us-east1 --project=test-proj --node-type=highmem-medium --shard-count=1 --mode=cluster-disabled --engine-configs=maxmemory-policy=allkeys-lru
Update a configuration parameter
To update a configuration parameter for an existing instance, run the
gcloud memorystore instances update
command with the --update-engine-configs
flag,
replacing variables with appropriate values.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --update-engine-configs=config-name=config-value
Example:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --update-engine-configs=maxmemory-policy=allkeys-lru
Reset a configuration parameter
To reset a configuration parameter to its default value, run the
gcloud memorystore instances update
command with the --remove-engine-configs
flag,
replacing variables with appropriate values.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --remove-engine-configs=config-name
Example:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --remove-engine-configs=maxmemory-policy
Clear configuration parameters
To clear all configuration parameters to their default values, run the
gcloud memorystore instances update
command with the --clear-engine-configs
flag,
replacing variables with appropriate values.
gcloud memorystore instances update instance-id \ --location=region-id \ --project=project-id \ --clear-engine-configs
Example:
gcloud memorystore instances update foo --location=us-east1 --project=test-proj --clear-engine-configs