Configure an instance

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 beta memorystore instances describe command replacing variables with appropriate values.

You can't see configuration parameters when running the gcloud beta memorystore instances describe command unless you have changed a configuration parameter from its default value.

gcloud beta memorystore instances describe instance-id --location=region-id

Example:

gcloud beta 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 beta memorystore instances create command with --engine-configs flag replacing variables with appropriate values.

gcloud beta memorystore instances create instance-id \
--location=region-id \
--project=project-id \
--node-type=node-type \
--shard-count=shard-count \
--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. To see more details about instance specification, see Instance and node specification.

  • config-name is the configuration parameter to modify.

  • config-value is your chosen setting corresponding to the parameter you're configuring.

For example:

gcloud beta memorystore instances create foo --location=us-east1 --project=test-proj --node-type=highmem-medium --shard-count=3 --engine-configs=maxmemory-policy=allkeys-lru

Update a configuration parameter

To update a configuration parameter for an existing instance, run the gcloud beta memorystore instances update command with the --update-engine-configs flag replacing variables with appropriate values.

gcloud beta memorystore instances update instance-id \
--location=region-id \
--project=project-id \
--update-engine-configs=config-name=config-value

Example:

gcloud beta 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 beta memorystore instances update command with the --remove-engine-configs flag replacing variables with appropriate values.

gcloud beta memorystore instances update instance-id \
--location=region-id \
--project=project-id \
--remove-engine-configs=config-name

Example:

gcloud beta 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 beta memorystore instances update command with the --clear-engine-configs flag replacing variables with appropriate values.

gcloud beta memorystore instances update instance-id \
--location=region-id \
--project=project-id \
--clear-engine-configs

Example:

gcloud beta memorystore instances update foo --location=us-east1 --project=test-proj --clear-engine-configs