Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchRedis can evict expiring session keys for days before it reaches a point where it cannot accept another write. In Sergey Shinder’s account of an outage, one Redis cluster held both page cache and sessions under volatile-lru; a new set of non-expiring “recently viewed” keys gradually consumed the memory that expiring data depended on. Redis documentation confirms that this policy evicts only keys with an expiration and that writes can fail when no eligible keys remain. The incident details are the author’s account and have not been independently corroborated.
What happened in the reported outage
Shinder says users were being logged out for roughly two weeks in May before a Thursday-afternoon login outage. The shared Redis cluster stored page-cache entries and sessions, both with expirations. In April, the team added recently viewed items without expirations. As that data grew, Redis evicted expiring keys—including sessions—to stay within its memory limit. The author reports that login writes eventually failed with OOM command not allowed when used memory > 'maxmemory'.
As an Amazon Associate I earn from qualifying purchases.
According to the account, moving recently viewed lists to Postgres restored logins that evening. The account does not identify the year, Redis release, topology, or scale, and its incident telemetry is not independently verified.
Why users were logged out before Redis rejected writes
The two symptoms reflect different stages of memory pressure. Redis’s maxmemory limit invokes the configured eviction policy when writes would push the dataset beyond the limit. Under volatile-lru, Redis chooses least-recently-used keys only from those with an expiration. Sessions were therefore eligible for removal along with page-cache entries, while the non-expiring recently viewed keys were not.
#1 Best Overall
As long as expiring keys remained, Redis could make room by evicting them. Losing a session can log its user out even though Redis is still accepting writes. When the eligible expiring keys are exhausted, a volatile policy behaves like noeviction: new data-producing commands can return errors at the limit. Reads of existing keys can still work, but a login flow that must write session state may fail.
What the policies permit Redis to remove
| Policy | Keys eligible for eviction | When memory is full | Fit for this incident’s data types |
|---|---|---|---|
volatile-lru |
Least-recently-used keys that have an expiration | If no keys have an expiration, it acts like noeviction and new writes can fail |
Can remove expiring sessions as well as cache entries; non-expiring keys can still consume memory |
allkeys-lru |
Least-recently-used keys, whether or not they have an expiration | Evicts keys to make room under the configured limit | Can suit disposable cache data, but can also remove sessions or other keys if they share the store |
noeviction |
No keys | New data-producing commands return errors; reads of existing keys remain available | Prevents eviction but requires adequate capacity and an application plan for rejected writes |
These distinctions follow Redis’s documented eviction behavior. An eviction policy is a decision about which data the application can afford to lose, not merely a way to keep a memory graph below a limit.
Rank #2
How TTLs change eligibility
A key’s expiration affects both its lifetime and whether it can be selected by a volatile policy. Redis supports setting a TTL with EXPIRE or with a command option such as SET key value EX seconds. When the TTL elapses, the key is destroyed. With a volatile policy, a key without an expiration is outside the candidate set even if it is less valuable than the expiring keys Redis can remove.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →That creates a dangerous mix in one instance: permanent or long-lived application data can take an increasing share of memory while expiring sessions remain eligible for eviction. Applying a TTL indiscriminately is not a fix if the data must persist; the right choice depends on whether losing that key is acceptable.
Rank #3
How to prevent cache pressure from destroying sessions
Separate data with different loss tolerance
Redis documentation suggests considering separate instances for cache data and persistent keys where possible. Disposable cache data can use an eviction policy such as allkeys-lru if any cache entry may be safely regenerated. Session or durable state needs a design that protects it from cache eviction, plus capacity planning and appropriate persistence and failover decisions. A separate instance alone does not guarantee availability or durability.
Make expiration choices explicit
Review code paths that write to Redis and distinguish cache entries, sessions, and intentionally persistent data. A client wrapper can require a TTL unless a caller explicitly identifies permanent storage; Shinder says his team adopted that safeguard after the incident. It is a guard against accidental non-expiring keys, not a substitute for choosing the right store or policy.
Size and alert for the protected workload
The author reports sizing a separate session Redis for peak use with headroom and alerting at 70% memory use. That was the team’s threshold, not a general Redis benchmark or universal alert target. Capacity targets should reflect the deployment’s workload and the consequences of a rejected session write.
What to monitor when Redis is near its memory limit
A full memory graph alone does not reveal whether Redis is shedding the wrong keys or already rejecting writes. Redis’s INFO output exposes relevant measurements, including evicted_keys, expired-key counts, memory usage, and time above maxmemory. Interpret counters alongside the configured policy and the data types in each instance.
- Track evictions and determine whether the affected instance contains sessions or other state the application cannot afford to lose.
- Watch for rejected write commands and application errors, including the reported
OOM command not allowedresponse. - Monitor memory use against
maxmemory, and investigate sustained pressure rather than treating it as normal simply because the service is still responding. - Review key expiration and keyspace information in the context of the deployed Redis version and configuration. The author specifically cites
INFO keyspacefor per-database expiry counts; verify the relevant output for your deployment instead of assuming that detail applies universally.
Shinder also reports alerting on any session-store eviction and on the proportion of expiring keys. Those were choices in this team’s response, not prescribed Redis thresholds.
What the incident illustrates
The outage account describes a failure caused by mixing workloads with different loss tolerances under a policy that treated every expiring key as disposable. Redis’s documented behavior explains why sessions could disappear before writes stopped: the policy first evicted eligible TTL keys, then rejected new writes when it could no longer free space. The practical control is to decide which data may be evicted, isolate workloads when their requirements differ, and monitor both evictions and write failures.
Sources: Redis eviction documentation; Redis EXPIRE command documentation; Redis INFO command documentation; Sergey Shinder’s incident account.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




