Skip to content

Need advice for upgrading node type in Elasticache Redis clusters

0

In our production environment we need to upgrade these 2 Redis clusters on Redis v5.0.6 to cache node type cache.m6g.4xlarge

  1. 1 primary and 1 replica currently at node type cache.m5.2xlarge
  2. 1 primary and 2 replicas currently at node type cache.m6g.2xlarge

Please note, we are not planning to upgrade the Redis version at this time, but some time later.

In our test environment we tested upgrading the #1 configuration above to cache.m6g.4xlarge. This took 20-30 minutes. Have a few questions related to this:

  1. How do we reduce the time it takes to do this upgrade?
  2. In our production environments, there are on average about 2000 connections to the primary redis node. Will this impact the time it takes to upgrade? For comparison, our test environment had about 200 connections to the primary redis node.
  3. How do we ensure that no data is lost due to this upgrade?
  4. How do we minimize the time window during the upgrade when new connections to the primary will be rejected and existing connections will be broken? Also, approximately how long will this window be?

Would also appreciate any general advice relevant to doing this upgrade. Thanks Rohit

asked a year ago776 views

2 Answers
0

Advice for Upgrading ElastiCache Redis Node Types

Reducing Upgrade Time

The upgrade time for node type modifications depends on several factors including the amount of data stored and the replication process. To reduce the time:

  • Schedule the upgrade during low-traffic periods to minimize impact
  • Ensure you're using the ApplyImmediately=true parameter when initiating the upgrade through the ModifyReplicationGroup API if you want the changes to take effect immediately rather than waiting for the next maintenance window
  • Consider that vertical scaling creates new nodes and synchronizes data between old and new nodes, so having less data will result in faster upgrades

Impact of Connection Count

The higher number of connections (2000 vs 200) will likely impact the upgrade process. When upgrading the engine, ElastiCache terminates existing client connections, so more connections means more reconnection attempts. This could potentially extend the perceived downtime from the client perspective.

Ensuring Data Safety

The ElastiCache engine upgrade process is designed to make a best effort to retain your existing data and requires successful Redis replication. The vertical scaling process creates new nodes with the requested node type and synchronizes data from the old nodes to the new ones before switching over.

Minimizing Connection Disruption

To minimize connection disruption:

  • Implement best practices for Redis clients with error retries and exponential backoff
  • Follow best practices for minimizing downtime during maintenance
  • Client applications should be designed to handle connection failures gracefully with automatic reconnection logic

The window when connections will be disrupted is typically during the DNS propagation phase. For Redis versions 5.0.6 and higher, this is designed to have minimal downtime. However, you should still expect a brief period (typically seconds) where connections will be terminated and need to reconnect.

General Advice

answered a year ago

0

Hello.

As described in the following documentation, we recommend changing the node type during periods of low traffic.
In the past, we have tested changing node types and have observed temporary increases in latency during the change.
If your application can handle some downtime, it is recommended that you do so during this time.
https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/redis-cluster-vertical-scaling.html

While the vertical scaling process is designed to remain fully online, it does rely on synchronizing data between the old node and the new node. We recommend that you initiate scale up/down during hours when you expect data traffic to be at its minimum.

I think if you change the node type during times of high traffic, it takes time to synchronize data within the cluster.
https://repost.aws/knowledge-center/elasticache-redis-minimize-time-scaling

To minimize downtime during synchronization, avoid scaling when you have a high workload. If the cluster has a high workload and scaling is taking a long time, then reduce the incoming requests to Redis to prevent synchronization failure. If synchronization occurs, then check the SaveInProgress metric in Amazon CloudWatch to determine when the synchronization occurred. Note that the SaveInProgress metric collects data every minute and might not capture synchronization that finished under one minute. For more information, see Monitoring best practices with Amazon ElastiCache for Redis using Amazon CloudWatch.

EXPERT

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.