Dragonfly

How Do I Reduce My ElastiCache Bill?

A breakdown of AWS's own cost levers for ElastiCache, and an honest look at when consolidating onto a different engine is (and isn't) the bigger one.

July 11, 2023

cover

The short answer

Amazon ElastiCache bills grow from three levers: node type and count, on-demand versus reserved pricing, and engine choice. AWS itself discounts reserved nodes up to 55%, prices Valkey 20 to 33% below Redis OSS, and offers data tiering for cold data. A fourth lever, consolidating onto fewer, larger nodes, only helps when the bottleneck is throughput, not memory.

The rest of this guide covers all four honestly, including the one AWS won't sell you: switching the underlying engine.


What are AWS's own levers for cutting an ElastiCache bill?

Four levers exist inside ElastiCache itself, before you touch anything about the engine.

Reserve capacity you already know you need

Reserved nodes trade a one- or three-year commitment for a discount off the on-demand hourly rate. AWS publishes three tiers, all size-flexible, meaning a reservation for one node size applies its discount across other sizes in the same family:

Commitment

Discount vs. on-demand

No Upfront

up to 48.2%

Partial Upfront

up to 52%

All Upfront

up to 55%

Reservations only pay off for a baseline you actually run year-round. A workload that's mostly idle outside business hours, or that you expect to shrink, is a worse candidate than a steady floor of traffic.

Switch the engine to Valkey, not the vendor

This is the cheapest lever and the one most teams miss because it sounds bigger than it is. Switching your ElastiCache engine from Redis OSS to Valkey (the Linux Foundation's fork, API-compatible with Redis) is priced 20% lower on node-based clusters and roughly 33% lower on serverless, with a lower serverless storage minimum (100 MB versus 1 GB). Existing Redis OSS reserved nodes carry their discount over to Valkey nodes in the same family and region, and AWS states you get 20% more value from an existing reservation after the switch, since Valkey's lower unit price stretches the same reserved spend across more capacity. AWS and Google Cloud both default new deployments to Valkey already, so for a new cache this isn't really a decision to make, it's a default to keep.

Move cold data to disk with data tiering

Data tiering nodes (the R6gd family) keep hot keys in memory and move infrequently accessed items to local SSD, at the cost of higher latency the first time a cold item is read. AWS's own published example for a 1 TB dataset that's mostly cold: one cache.r6gd.16xlarge node at $9.98/hr covers it with tiering, against four cache.r6g.16xlarge nodes at $5.25/hr each ($21.01/hr total) to hold the same 1 TB fully in memory, a 52.5% reduction. AWS's own guidance is that this only fits workloads that regularly touch up to about 20% of their stored data; a dataset with uniformly hot access patterns will just pay the latency without the savings.

Check whether you're paying an Extended Support penalty

A bill that's crept up with no change in traffic is sometimes not a scaling problem: it's an end-of-life penalty. AWS charges an 80% premium over on-demand pricing for Redis OSS major versions running past their community end-of-life, rising to 160% in year three. A cache.m5.large instance normally billed at $0.1560/hr costs $0.2808/hr under that 80% premium, and $0.4056/hr once the 160% tier applies. If your ElastiCache bill jumped without a matching jump in usage, check your engine version against AWS's end-of-life schedule before assuming you need bigger or fewer nodes.


Redis memory costs too high, what are my options?

Before touching nodes, cloud provider, or engine, make sure the memory you're paying for is memory you need:

  • Use compact data structures. A hash mapping fields to values costs less memory than the equivalent JSON blob stored as a single string, and lets you update one field without rewriting the whole value.
  • Cap unbounded collections. Lists and sorted sets that grow forever (event logs, activity feeds) should be trimmed with LTRIM or ZREMRANGEBYRANK rather than left to grow into the next node size up.
  • Set TTLs on anything ephemeral. Session data, rate-limit counters, and cache entries that outlive their usefulness are the most common source of memory bloat that node right-sizing alone won't fix.

These are free and they compound with reserved nodes and data tiering. If you've already done all of the above, plus right-sized and reserved capacity, and the bill is still large relative to your actual traffic, the remaining lever isn't a memory problem anymore. It's an architectural one: how many nodes it takes to serve your request rate, not your dataset size.


Is switching the underlying engine actually one of these levers?

For most workloads, no. Redis OSS, Valkey, and Dragonfly all bill by node-hour (or GB-hour) on comparable AWS instance types, so if your dataset comfortably fits and your request rate comfortably fits, the engine underneath is a licensing and support decision, not a cost lever.

It becomes a cost lever specifically when a workload is throughput-bound rather than memory-bound. Redis and Valkey both execute commands on a single thread per shard; Valkey 8 and 9 added asynchronous I/O and memory prefetching, but command execution itself is still single-threaded by design. Scaling past what one core can push means adding shards, and ElastiCache bills per node regardless of whether those extra shards exist for memory or for throughput. A multi-threaded engine that uses all the cores on one instance can serve the same request rate from fewer, larger nodes, and fewer billed nodes is a direct line item, not just an operational simplification.

Dragonfly Cloud publishes a worked example of exactly this pattern:


Node type

Nodes

Monthly cost

ElastiCache (Redis OSS)

cache.r7g.4xlarge

4

$5,100

Dragonfly Cloud

Standard (100 GB)

2

$1,600

Workload: 100 GB dataset, roughly 2,500,000 requests/second, US East (N. Virginia). The customer needed four cache.r7g.4xlarge ElastiCache nodes not because 100 GB of memory required it, but because a single-threaded engine needed that many shards to keep up with the request rate. The same workload ran on two Dragonfly Cloud nodes at $1,600 a month, about a 69% reduction ($5,100 to $1,600).

That figure is one customer's numbers for one workload shape (published by Dragonfly, see Dragonfly Cloud's pricing page), not a universal multiplier. It applies specifically because that workload was throughput-bound: the memory footprint alone would have fit on far fewer nodes. Run both providers' current calculators against your own dataset size and request rate before treating any number on this page, including AWS's own worked examples above, as your number; both vendors' list prices change.


When will switching engines not save you money?

  • Your workload is memory-bound, not throughput-bound. A large, low-QPS dataset that already fits on one or two nodes gets little from a multi-threaded engine, because you were never paying for extra shards to begin with. Reserved nodes and data tiering already capture most of the available savings here, and they're lower-effort than a migration.
  • The migration cost exceeds the savings. For a workload already near the lower end of ElastiCache's pricing (a few hundred dollars a month), the engineering time to test, cut over, and validate a new engine can easily cost more than a year of the difference.
  • You depend on an ElastiCache-specific managed feature. Global Datastore cross-region replication, AWS Outposts deployment, or IAM-based auth wired into an existing ElastiCache topology all mean re-architecting around the feature, not just swapping the engine underneath it.
  • You've already captured the cheap levers. If you're already on Valkey, already using reserved nodes, and already tiering cold data, the remaining gap versus a from-scratch multi-threaded engine is smaller than the headline percentage above for anything that isn't genuinely throughput-bound.

Work through the AWS-side levers first regardless of which engine you end up on. They're free to apply, and they'll tell you honestly whether you have a node-count problem or a memory problem before you consider anything else.