2.4.18

Latest release in branch 2.4
Released 13 years ago (November 28, 2012)

Software Redis
Branch 2.4
Status
End of life
First official release version 2.4.0
First official release date 14 years ago (October 14, 2011)
Source code https://github.com/redis/redis/tree/2.4.18
Documentation https://redis.io/docs/
Download https://download.redis.io/releases/
Redis 2.4 Releases View full list

What Is New in Redis 2.4

Redis 2.4 brings a solid set of enhancements focused on operational stability, new data type operations, and better introspection. The main updates are summarized below.

Category Key Changes
New Features Variadic commands for lists/sets, bit operations, millisecond precision expires, client introspection.
Performance & Core Better memory efficiency, faster saving for small lists/sets/hashes, optimized LRU eviction.
Persistence & Replication Background saving for AOF rewrite, replication improvements for partial resyncs.
Configuration & Admin New redis-cli commands, configurable max client limits, log format changes.
Bug Fixes Fixes for AOF, replication edge cases, and memory handling.

What new commands and operations were added?

The biggest usability win is variadic push/pop operations. You can now push multiple elements to a list with a single LPUSH or RPUSH call, which cuts down on round trips and network overhead. The same goes for SADD and SREM.

Bit-level operations on strings are a game-changer for dense flag storage. SETBIT, GETBIT, and BITCOUNT let you use Redis as a massive bitmap, perfect for real-time analytics like unique daily visitors.

For finer control over expirations, the PEXPIRE, PTTL, and PERSIST commands work with millisecond precision. This matters because a one-second granularity was often too coarse for caching layers and lock management.

How did performance and memory usage improve?

Small aggregate data types (lists, sets, hashes with few elements) now use less memory and save to disk faster. In practice, this means your memory footprint shrinks if you store lots of small collections, which is common for session data or feature flags.

The LRU eviction algorithm was optimized to be more probabilistic and less CPU-intensive. You won't see Redis freezing to pick the perfect key to evict under memory pressure. It's a trade-off that works better for high-throughput scenarios.

Internal encoding improvements make iterating over hashes and sets more efficient. This directly speeds up commands like HGETALL or SMEMBERS on certain sized collections.

What changed for persistence and replication reliability?

The Append-Only File (AOF) rewrite now happens in a background thread (where possible). This prevents the main event loop from blocking during rewrites, keeping your instance responsive. It's a major fix for the "latency spike during BGREWRITEAOF" problem.

Replication got more resilient to temporary network hiccups. The master better handles partial resynchronization attempts from replicas, reducing the chance of needing a full sync after a brief disconnect. This saves network bandwidth and load.

There's also better handling of the AOF file descriptor during fsync policies, fixing a few edge-case crashes that could happen when the system is under heavy disk I/O load.

What new tools do admins get for client management?

The CLIENT LIST command now provides a critical view into connected clients, showing their address, idle time, and command flags. This is the first step towards debugging connection leaks or identifying noisy clients.

redis-cli, the command-line interface, gained the --scan option to incrementally iterate over keys, and --eval for direct Lua script execution. These make automation and scripting much smoother outside of a application client.

You can now set a hard limit on the number of clients via maxclients in the config file. Hitting this limit will reject new connections instead of letting memory usage spiral. The logging format was also updated to be more parsable.

FAQ

Does the variadic LPUSH break compatibility with older clients?
No. The protocol change is backward compatible. Older clients sending multiple arguments to the old LPUSH will see it as a single multi-element push. New clients can use the same command format. The server handles both.

When should I use bit operations versus a regular set?
Use bit operations for extremely dense, binary state tracking across a large, numeric ID space (like user IDs). A set is better for sparse collections or when you need member-level TTLs. Bitmaps can save orders of magnitude more memory for things like daily active user flags.

Is the background AOF rewrite always safe?
Mostly. It minimizes main thread blocking, but you still need sufficient disk I/O capacity. If the background rewrite can't keep up with the write rate, the main thread may still slow. Monitor your disk latency during rewrites.

How does the new LRU eviction actually work?
It samples a pool of random keys and evicts the best candidate from that sample, instead of scanning all keys. This makes the eviction process O(1) and prevents performance degradation as your total key count grows, at a slight cost in precision.

Can I upgrade from 2.2 to 2.4 directly without a restart?
No. A restart is required. The on-disk format for RDB files is compatible, so you can use a persistent dump to migrate. Replication from a 2.4 master to a 2.2 replica may have issues due to new protocol bits; it's best to upgrade replicas first.

Releases In Branch 2.4

Version Release date
2.4.18 13 years ago
(November 28, 2012)
2.4.17 13 years ago
(August 30, 2012)
2.4.16 13 years ago
(August 01, 2012)
2.4.15 13 years ago
(June 21, 2012)
2.4.14 13 years ago
(May 23, 2012)
2.4.13 13 years ago
(May 02, 2012)
2.4.12 13 years ago
(April 30, 2012)
2.4.11 13 years ago
(April 19, 2012)
2.4.10 14 years ago
(March 30, 2012)
2.4.9 14 years ago
(March 18, 2012)
2.4.8 14 years ago
(February 22, 2012)
2.4.7 14 years ago
(February 02, 2012)
2.4.6 14 years ago
(January 11, 2012)
2.4.5 14 years ago
(December 23, 2011)
2.4.4 14 years ago
(November 28, 2011)
2.4.3 14 years ago
(November 21, 2011)
2.4.2 14 years ago
(October 26, 2011)
2.4.1 14 years ago
(October 17, 2011)
2.4.0 14 years ago
(October 14, 2011)
2.4.0-rc8 14 years ago
(September 21, 2011)
2.4.0-rc7 14 years ago
(September 12, 2011)
2.4.0-rc6 14 years ago
(August 09, 2011)
2.4.0-rc5 14 years ago
(July 29, 2011)
2.4.0-rc4 14 years ago
(July 22, 2011)
2.4.0-rc3 14 years ago
(July 15, 2011)
2.4.0-rc2 14 years ago
(June 09, 2011)
2.4.0-rc1 14 years ago
(June 09, 2011)