Behavior during scaling

This page describes how your Cloud Memorystore for Redis instance behaves during scaling. To learn how to scale a Redis instance, see Scaling Redis Instances.

Depending on the instance's tier, scaling an instance has performance and storage implications for your application. There are also some limitations to scaling instances based on the amount of memory that is currently in use. This section describes how scaling an instance can affect your application and when you can scale an instance.

Scaling a Basic Tier instance

Basic Tier instances block reads and writes while the instance is resized to the desired capacity. After the instance is resized, all data is flushed from the cache. Scale an instance during a period of low activity to minimize the performance impact on your application.

Scaling a Standard Tier instance

Standard Tier instances experience almost no downtime during the scaling process because all Standard Tier instances have masters and replicas. During scaling, the replica is resized first, then synced with the master. Once the replica has caught up with the master, the master fails over to the replica. During the failover, connections to the instance are terminated. Applications should incorporate retry logic in the code to be able to reconnect to the new master. Finally, the old master instance is resized.

After scaling is complete, there may be stale or inconsistent data in the cache because of the asynchronous nature of Redis replication. The application should be resilient enough to handle inconsistencies that arise during failover.

Write load during scaling

When scaling a Standard Tier instance, keep the instance write load to a minimum. A high write load can cause scaling to take significantly longer and can cause the scaling operation to fail.

Expired keys

When you scale a Standard Tier instance, expired keys are not synced. If you have expired keys in your Redis instance before you scale, you will have fewer keys after the instance is scaled.

Requirements for reducing capacity

When reducing a Standard Tier instance’s capacity, you must choose a size greater than the amount of data being stored or scaling fails. For example, if your instance is using 5.5 GB of storage, you can resize the instance to a minimum of 6 GB.

Was this page helpful? Let us know how we did:

Send feedback about...

Google Cloud Memorystore for Redis