Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Redis Eviction Failure: Why Sessions Disappeared Before Writes Failed

With volatile-lru, Redis can evict expiring sessions while permanent keys take up memory. Here’s why the reported outage progressed from logouts to rejected writes.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Redis 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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 allowed response.
  • 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 keyspace for 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.