AWS Database Blog
Boosting application performance and reducing costs with Amazon ElastiCache for Redis
Contributed by Senior Software Development Engineer, Shawn Wang, Software Development Engineer, Maddy Olson, and Senior Manager, Software Engineering, Itay Maoz.
Amazon ElastiCache for Redis helps customers achieve extreme performance with very low latencies at cloud scale and minimal management costs. Redis’s high performance, simplicity, and support for diverse data structures have made it the most popular NoSQL key-value store. Whether it is caching, real time analytics, gaming leaderboards, or chat and messaging, speed wins and Amazon ElastiCache for Redis makes it easy.
Last year, we started on a journey to make ElastiCache deliver even better performance on AWS. As part of adding support for M5 and R5 instances in ElastiCache, we worked with the AWS Nitro–based system and optimized our instances for running ElastiCache for Redis. We tuned M5 and R5 networking performance by optimizing the Amazon base Linux image. The results were promising. We saw up to 144 percent more transactions per second on R5 as compared to R4’s. We reduced average (p50) and tail (p99) latencies up to 23 percent. Since then, many large ElastiCache customers have taken advantage of better, faster, and cheaper R5 nodes.
Enhanced I/O handling in Amazon ElastiCache for Redis 5.0.3
Today, we are announcing dynamic network processing to improve I/O request processing within Amazon ElastiCache for Redis 5.0.3. With this feature, Amazon ElastiCache for Redis now can deliver up to an 83 percent better throughput per node and up to a 47 percent reduction in latency. That’s on top of the aforementioned M5 and R5 performance improvements. By taking advantage of the extra CPU power available in nodes that have four or more vCPUs, ElastiCache for Redis is able to offload network processing, which often is a bottleneck for Redis workloads. Taking this approach reduces latency and improves throughput.
We ran a Redis benchmark with 14.7 million unique keys, 16-byte key value length, 200-byte string values, 80 percent gets, 20 percent sets, and no command pipelining. All tests began with an empty Redis database. We used an optimized R5 instance in the same Availability Zone as the 15 Amazon EC2 instance clients.
With 100 client connections, we saw up to a 56 percent better throughput and a slight improvement in p50 latency. With 800 client connections and high contention, the enhanced I/O handling resulted in an even better throughput gain (up to 83 percent).
The enhanced I/O handling also resulted in up to 47 percent lower client-side latency (p50). For details, see the following tables.
A test with 100 client connections
R5 node | Before enhanced I/O handling (ElastiCache for Redis 5.0.0 or earlier) |
With enhanced I/O handling (ElastiCache for Redis 5.0.3) |
Throughput gain |
Xlarge | 215,000 RPS | 245,000 RPS | 13% |
2Xlarge | 208, 000 RPS | 327,000 RPS | 56% |
4Xlarge | 232,000 RPS | 347,000 RPS | 49% |
12Xlarge | 252,000 RPS | 389,000 RPS | 54% |
24Xlarge | 259,000 RPS | 407,000 RPS | 56% |
At a higher number of concurrent connections, throughput got even better, as shown in the following table.
A test with 800 client connections
R5 node | Before enhanced I/O handling (ElastiCache for Redis 5.0.0 or earlier) |
With enhanced I/O handling (ElastiCache for Redis 5.0.3) |
Throughput gain |
Xlarge | 209,000 RPS | 238,000 RPS | 13% |
2Xlarge | 201,000 RPS | 360,000 RPS | 78% |
4Xlarge | 247,000 RPS | 453,000 RPS | 83% |
12Xlarge | 257,000 RPS | 452,000 RPS | 75% |
24Xlarge | 254,000 RPS | 434,000 RPS | 70% |
Summary
We are excited to announce the network handling improvements in Amazon ElastiCache for Redis. You can now get more throughput from your existing nodes without having to spend more money on larger nodes or additional shards. We will continue to invest in optimizing Redis performance and pass the benefits to our customers. To get started with ElastiCache for Redis, see the AWS Management Console.
About the Author
Ruchita Arora is a Senior Product Manager for Amazon ElastiCache.