{"id":74574,"date":"2026-06-12T02:09:06","date_gmt":"2026-06-12T08:09:06","guid":{"rendered":"https:\/\/www.scalahosting.com\/blog\/?p=74574"},"modified":"2026-06-12T02:09:08","modified_gmt":"2026-06-12T08:09:08","slug":"redis-eviction-policies","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/blog\/redis-eviction-policies\/","title":{"rendered":"Redis Eviction Policies: Which One to Use"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Your <a href=\"https:\/\/www.scalahosting.com\/blog\/redis-vs-memcached\/\"><strong>Redis<\/strong><\/a> cache fills up. It always does &#8211; that&#8217;s the point of a memory limit. What happens in the next millisecond is decided by a single setting most people accept the default for and never look at again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The eviction policy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Get it right, and Redis quietly protects your busiest data, keeps your hit rate high, and makes your site feel fast under load. Get it wrong, and Redis may evict useful keys or reject writes, depending on the policy. In SPanel, the policy is exposed as a dropdown instead of a manual redis.conf edit.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The performance gap is real &#8211; a Deloitte study found that <a href=\"https:\/\/www.deloitte.com\/ie\/en\/services\/consulting\/research\/milliseconds-make-millions.html\" rel=\"nofollow\">a 0.1-second improvement in mobile site speed lifted retail conversion rates by 8.4%<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So let&#8217;s clear up what a Redis eviction policy actually does, walk through all eight of them in plain language, and land on the one you should probably use.<\/p>\n\n\n\n<p class=\"alert-green wp-block-paragraph\"><a href=\"https:\/\/www.scalahosting.com\/spanel.html\"><strong>SPanel<\/strong><\/a> users can change the Redis eviction policy from the Redis Cache screen instead of editing. Simply go to the <strong>Redis Cache Manager,<\/strong> and you will see a <strong>Mempolicy <\/strong>dropdown on the left side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What Is a Redis Eviction Policy?<\/strong><strong><\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><img decoding=\"async\" width=\"1140\" height=\"513\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/Redis-Eviction-Policies-1140x513-1.webp\" alt=\"Redis Eviction Policies: Which One to Use, What Is a Redis Eviction Policy?\" class=\"wp-image-74576\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/Redis-Eviction-Policies-1140x513-1.webp 1140w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/Redis-Eviction-Policies-1140x513-1-300x135.webp 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/Redis-Eviction-Policies-1140x513-1-768x346.webp 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A Redis eviction policy is the rule Redis follows to decide which keys to delete when its memory limit is reached and a new write needs room. It answers one question: when the cache is full, what gets thrown out to make space?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things have to be true before eviction ever happens:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>A memory ceiling exists.<\/strong> Redis only evicts when it hits the limit set by its<a href=\"https:\/\/redis.io\/docs\/latest\/develop\/reference\/eviction\/\" rel=\"nofollow\"> maxmemory value<\/a>. With no limit, Redis keeps consuming RAM until the operating system steps in &#8211; which is its own kind of problem.<\/li>\n\n\n\n<li><strong>A new write needs space.<\/strong> Eviction is triggered by demand. Redis frees room reactively, key by key, as writes come in and memory is already full.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s the part that trips people up.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Out of the box, open-source Redis ships with noeviction as its default policy, which means it evicts <em>nothing<\/em> and starts rejecting writes once memory fills. That&#8217;s a safe default for a database, but a poor one for a cache. (More on why in a moment &#8211; and it&#8217;s a big reason managed environments override it.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Volatile vs. Allkeys: The First Fork in the Road<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before the eight Redis eviction policies make sense, you need one distinction. Every policy operates over one of two scopes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Allkeys<\/strong> policies can evict <em>any<\/em> key in the cache, whether or not it has an expiration time.<\/li>\n\n\n\n<li><strong>Volatile<\/strong> policies can only evict keys that have a <strong>TTL<\/strong> (time to live) set &#8211; a built-in expiration. Keys without a TTL are protected and never touched.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That single choice &#8211; every key is fair game, or only the ones you&#8217;ve explicitly marked as temporary &#8211; shapes everything else.<\/p>\n\n\n\n<div class=\"wp-block-group alert-green\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\"><strong>How SPanel handles this differently<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In SPanel, Redis is not a shared cache service. Each hosting account gets its own Redis instance with a private loopback address, its own password, its own memory budget, and its own eviction policy. The default is allkeys-lfu with a 256 MB memory limit, which is a sensible starting point for most WordPress, WooCommerce, and application-cache workloads. If your workload needs something else, you can change the policy from the Redis Cache settings form instead of editing redis.conf over SSH.&nbsp;<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>All Eight Redis Eviction Policies Explained<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Redis supports eight eviction policies. Six are combinations of a <em>scope<\/em> (volatile or allkeys) and a <em>strategy<\/em> (LRU, LFU, or random), plus two specialists: one TTL-based policy and noeviction. The matrix below shows how they line up.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><img decoding=\"async\" width=\"1140\" height=\"685\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1-1140x685.webp\" alt=\"Redis Eviction Policies: Which One to Use, All Eight Redis Eviction Policies Explained\" class=\"wp-image-74577\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1-1140x685.webp 1140w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1-300x180.webp 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1-768x462.webp 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1-1536x924.webp 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image4-1.webp 1999w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Here&#8217;s each one, and the workload it fits:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular green-rows\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Policy<\/strong><\/th><th><strong>Scope<\/strong><\/th><th><strong>Removes first<\/strong><\/th><th><strong>Best for<\/strong><\/th><\/tr><\/thead><tbody><tr><td><strong>allkeys-lru<\/strong><\/td><td>Every key<\/td><td>Least recently accessed key<\/td><td>General caches with no TTLs set<\/td><\/tr><tr><td><strong>allkeys-lfu<\/strong><\/td><td>Every key<\/td><td>Least frequently accessed key<\/td><td>Most application caches <em>(recommended default)<\/em><\/td><\/tr><tr><td><strong>allkeys-random<\/strong><\/td><td>Every key<\/td><td>A random key<\/td><td>Uniform access where no key is &#8220;hotter.&#8221;<\/td><\/tr><tr><td><strong>volatile-lru<\/strong><\/td><td>TTL keys only<\/td><td>Least recently accessed TTL key<\/td><td>Mixed cache + must-keep data<\/td><\/tr><tr><td><strong>volatile-lfu<\/strong><\/td><td>TTL keys only<\/td><td>Least frequently accessed TTL key<\/td><td>Mixed data, frequency-based caching<\/td><\/tr><tr><td><strong>volatile-random<\/strong><\/td><td>TTL keys only<\/td><td>A random TTL key<\/td><td>Mixed data, low-stakes eviction<\/td><\/tr><tr><td><strong>volatile-ttl<\/strong><\/td><td>TTL keys only<\/td><td>Key closest to expiring<\/td><td>Short-lived keys, rate limiters<\/td><\/tr><tr><td><strong>noeviction<\/strong><\/td><td>None<\/td><td>Nothing &#8211; writes error out<\/td><td>Persistent stores, never a pure cache<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The LRU Policies (volatile-lru, allkeys-lru)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">LRU stands for <em>Least Recently Used<\/em>. When memory fills, these policies evict the key that hasn&#8217;t been touched the longest, on the premise that the oldest untouched data is the least likely to be needed again. allkeys-lru applies that across your whole cache; volatile-lru restricts it to keys with a TTL. LRU is the classic, intuitive choice &#8211; and for years it was the only smart option Redis offered.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The LFU Policies (volatile-lfu, allkeys-lfu)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">LFU stands for <em>Least Frequently Used<\/em>, and it&#8217;s the upgrade most caches want. Instead of asking &#8220;what&#8217;s gone untouched longest?&#8221;, LFU asks &#8220;what gets used least often?&#8221; &#8211; and evicts that. The difference matters more than it sounds. A key accessed thousands of times an hour but quiet for the last few seconds survives under LFU, where naive LRU might discard it. Redis added LFU in version 4.0 for exactly this reason: it protects genuinely hot keys regardless of timing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Random Policies (volatile-random, allkeys-random)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">These do what the name says: when memory is full, Redis picks a key at random and evicts it. No tracking, no scoring, almost no overhead. Random eviction makes sense only when your access pattern is genuinely uniform &#8211; every key equally likely to be needed &#8211; so there&#8217;s nothing smarter to optimize for. In practice, that&#8217;s rare. Most real workloads have hot and cold data, and a frequency- or recency-aware policy beats a coin flip.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The TTL Policy (volatile-ttl)<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">volatile-ttl evicts the key with the shortest remaining time to live &#8211; the one closest to expiring anyway. It only looks at keys that carry a TTL. This is a smart fit when you deliberately attach expirations to your cache entries and you&#8217;d rather Redis clear out the soon-to-die keys first instead of guessing by access pattern. Think rate limiters, short-lived tokens, and time-boxed cache entries.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Noeviction<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">noeviction refuses to remove anything. When memory fills, Redis stops accepting writes that need more space and returns an out-of-memory error instead. Reads keep working; new writes fail until space is freed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That sounds broken for a cache &#8211; and it is. But it&#8217;s the right call when you&#8217;re using Redis as a store of record for data that can&#8217;t simply be regenerated, like a persistent counter or a queue. In that case, silently dropping a key is worse than rejecting a write. Just know that your application has to catch and handle that error gracefully, or users will see failures.<\/p>\n\n\n\n<p class=\"alert-blue wp-block-paragraph\"><strong>Important SPanel note:<\/strong> SPanel Redis is designed primarily as a fast, isolated cache for a hosting account. It is a single-node Redis instance on the same server as the site, and SPanel does not expose Redis clustering, replicas, high availability, or AOF persistence in the UI. If you use Redis for queues, counters, or other data that cannot be easily rebuilt, make sure your application can tolerate Redis persistence and availability limits \u2014 and handle noeviction write errors properly.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Allkeys-lfu vs. Allkeys-lru: Which Should You Use?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For a typical application cache, <strong>allkeys-lfu<\/strong> is the better choice &#8211; it keeps your most-used data based on how often it&#8217;s accessed, not just how recently. <strong>allkeys-lru<\/strong> is the safe, well-understood fallback that performs nearly as well and is easier to reason about.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The distinction comes down to one word &#8211; <em>frequency<\/em> versus <em>recency<\/em>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>allkeys-lru<\/strong> protects keys touched most recently. A key hammered all day but idle for ten seconds can get evicted if newer keys crowd it out.<\/li>\n\n\n\n<li><strong>allkeys-lfu<\/strong> protects keys touched most <em>often<\/em>. That same hot key survives because Redis tracks access frequency over time, not just its last-touched timestamp.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For caching a WordPress site&#8217;s repeated database lookups, an ecommerce catalog, or any workload with a clear set of popular items, frequency is the better signal. That&#8217;s why frequency-based eviction wins for most application caches.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>One honest caveat<\/strong>: both LRU and LFU in Redis are <em>approximations<\/em> &#8211; Redis samples a handful of keys rather than scanning the entire keyspace on every eviction, trading a sliver of precision for a lot of speed. You can tune that sampling, but the defaults are fine for the overwhelming majority of sites.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Choose the Right Eviction Policy<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The short version?&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re running a normal cache and you&#8217;re not sure, use <strong>allkeys-lfu<\/strong> and move on. It&#8217;s the sensible default for a reason. Reach for something else only when your workload gives you a specific reason to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use this flowchart to find your fit in about three questions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><img decoding=\"async\" width=\"1140\" height=\"885\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2-1140x885.webp\" alt=\"Redis Eviction Policies: Which One to Use, How to Choose the Right Eviction Policy\" class=\"wp-image-74578\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2-1140x885.webp 1140w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2-300x233.webp 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2-768x596.webp 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2-1536x1193.webp 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2026\/06\/image3-2.webp 1999w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Walking the logic in words:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Is Redis purely a cache?<\/strong> If the data lives somewhere else and can be rebuilt &#8211; your database, an API, application logic &#8211; then any key is safe to evict. Go to step 2. If not, you&#8217;re using Redis as a datastore; jump to step 3.<\/li>\n\n\n\n<li><strong>Do all your cached keys carry a TTL?<\/strong> If you&#8217;ve deliberately set expirations on everything and want eviction confined to those keys, volatile-lru or volatile-ttl fits. If your keys are a mix, or you haven&#8217;t set TTLs at all, allkeys-lfu is your answer.<\/li>\n\n\n\n<li><strong>Is some of that data truly must-keep?<\/strong> If yes, use volatile-lru so only your expirable cache keys get evicted while your real data stays put. If absolutely nothing may be dropped, noeviction is the only safe choice &#8211; and your code must handle the resulting write errors.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">One number tells you whether your choice is working: the <strong>evicted-key count<\/strong>. If Redis is evicting heavily while your cache hit rate sags, the cache is probably undersized, not mis-configured &#8211; and the fix is <strong>more memory, not a different policy<\/strong>. Both numbers sit in Redis&#8217;s own stats output, which any decent control panel will surface for you.<\/p>\n\n\n\n<div class=\"wp-block-group alert-green\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h4 class=\"wp-block-heading\"><strong>Watching Your Policy Work in SPanel<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">A good eviction policy is invisible when it&#8217;s working &#8211; so the way to confirm it is to look at the numbers. Open the Redis stats view in your SPanel account and watch two figures: your <strong>hit rate<\/strong> (how often requests are served from cache) and the <strong>evicted-key count<\/strong> (how many keys Redis is discarding to make room). If evictions are climbing while your hit rate sags, the cache is undersized &#8211; raise the memory limit from the same screen rather than switching policies. If you want to see exactly <em>which<\/em> keys your application is reading and writing, the <strong>Monitor<\/strong> tool streams every Redis command in real time for a duration you set \u2014 useful for confirming your cache plugin is actually using Redis. And after a code deploy that changes your cache keys, <strong>Flush Cache<\/strong> wipes the instance clean so the application rebuilds it correctly. These are self-service controls, not support tickets.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting Your Redis Eviction Policy the Easy Way<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On most platforms, changing an eviction policy means SSH-ing into a server, editing redis.conf by hand, getting the maxmemory-policy line exactly right, and restarting the service without breaking anything. For a non-developer running a busy store, that&#8217;s a support ticket and a nervous afternoon.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It doesn&#8217;t have to be.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On every ScalaHosting <a href=\"https:\/\/www.scalahosting.com\/blog\/top-9-benefits-of-managed-vps-hosting\/\"><strong>managed VPS hosting plan<\/strong><\/a>, Redis comes built in &#8211; no add-on, no premium tier &#8211; and the eviction policy is a labeled dropdown in the <strong>Redis Cache Manager<\/strong>, the Redis tool inside SPanel. Pick a policy, save, and SPanel applies the change and restarts the Redis service for you. You do not need to edit redis.conf or restart Redis manually.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On a typical self-managed server, changing Redis eviction policy means editing redis.conf, setting maxmemory-policy, and restarting Redis carefully. In SPanel, the policy is available from the Redis Cache settings form. Choose the policy, save the change, and SPanel applies it and restarts the Redis service for you.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A few decisions are already made well for you.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A fresh deploy hands you a working Redis with a 256 MB memory budget and allkeys-lfu set as the default &#8211; the right starting point for the vast majority of sites, so most customers never need to touch it.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What&#8217;s more, your cache isn&#8217;t shared.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every account gets its <strong>own isolated Redis instance<\/strong> on a private address with its own password, so another customer&#8217;s runaway client can&#8217;t crowd out your keys or read your data. And because that cache lives on the same machine as your site, the round trip between application and cache runs at local-network speed &#8211; which is exactly what makes caching pay off for a busy WooCommerce store during a sale or a high-traffic WordPress site under load.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s the kind of self-service control that developer-friendly hosting should offer by default, on infrastructure that already powers more than 700,000 websites across 120+ countries.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>The Bottom Line<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Eviction policy is one of those settings that costs you nothing to get right and quietly costs you performance when it&#8217;s wrong. For nearly every site, the answer is allkeys-lfu &#8211; keep what&#8217;s used most, drop what&#8217;s gone cold, and watch your hit rate. Pick something else only when your data tells you to.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;d rather change that setting from a dropdown than a config file &#8211; and have Redis included, isolated, and tuned sensibly from day one &#8211; a fully managed environment takes the server administration off your plate entirely.<\/p>\n\n\n<div class=\"shortcode-cta-new-wrap row cloudvps\">\r\n    <img decoding=\"async\" class=\"shortcode-logo\" src=\"\/blog\/images\/shortcode-bg-new-logo-cloudvps.svg\" alt=\"shortcode-logo\" title=\"shortcode-logo\"\/>\r\n    <div class=\"shortcode-cta-img col-10 col-sm-7 col-md-5\">\r\n        <img decoding=\"async\" class=\"shortcode-bg\" src=\"\/blog\/images\/shortcode-bg-new-cloudvps.webp\" alt=\"shortcode-bg\" title=\"shortcode-bg\"\/>\r\n    <\/div>\r\n    <div class=\"shortcode-cta-content col-12 col-md-7\">\r\n        <div class=\"content\">\r\n            <div class=\"heading\">Supercharge Your Business with an All-inclusive Fully Managed Cloud<\/div>\r\n            <div class=\"list-wrap\">\r\n                <div class=\"list\">\r\n                    <div><b>Free, Effortless & No-Downtime Migration<\/b><\/div>\r\n                    <div><b>Anytime Unconditional Money-back Guarantee<\/b><\/div>\r\n                    <div><b>Full Scalability & 24\/7 Expert Cloud Support<\/b><\/div>\r\n                <\/div>\r\n            <\/div>\r\n            <div class=\"btn-wrap row\">\r\n                <div class=\"col-auto\">\r\n                    <a class=\"button green\" href=\"https:\/\/www.scalahosting.com\/managed-cloud-hosting.html\">Start Now<\/a>\r\n                <\/div>\r\n                <div class=\"col-auto\">\r\n                    <button class=\"button brown_outer\" title=\"Contact Sales\" onclick=\"chatChangeVisibility(this, 'maximize', {}, 5);\">Chat with our Experts<\/button>\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Frequently Asked Questions<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>What is the default Redis eviction policy?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Open-source Redis defaults to noeviction, which evicts nothing and rejects new writes once memory is full. Because that behavior suits a datastore rather than a cache, managed environments typically override it &#8211; a fresh Redis deployed through SPanel&#8217;s Redis Cache Manager uses allkeys-lfu, the better default for application caching.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>What happens when Redis runs out of memory?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Redis applies whatever eviction policy you&#8217;ve configured. With an eviction policy like allkeys-lfu, it discards the least-valuable keys to make room and keeps serving requests. With noeviction, it stops accepting writes that need more space and returns an out-of-memory error instead, while reads continue to work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Is LFU better than LRU for caching?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> For most application caches, yes. LFU (Least Frequently Used) keeps the keys your application accesses most often, which protects genuinely hot data better than LRU (Least Recently Used), which only tracks how recently a key was touched. LRU remains a solid, simpler choice and performs nearly as well in many real-world workloads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>When not to use allkeys-lfu?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Do not use allkeys-lfu if Redis contains data that cannot be rebuilt. If some keys must never be evicted, use a volatile policy and set TTLs only on disposable cache keys. If no key may be dropped, use noeviction and make sure the application handles write errors.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>When should I use noeviction?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Use noeviction only when you&#8217;re treating Redis as a store of record rather than a cache &#8211; for data that can&#8217;t be regenerated if it&#8217;s dropped, such as a persistent counter or a queue. For anything that&#8217;s genuinely a cache, noeviction is the wrong choice, because rejecting writes is worse than evicting stale keys. Your application must also be written to handle the out-of-memory errors it produces.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Do I need to change the eviction policy myself?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Usually not. allkeys-lfu is the right starting point for the large majority of caching workloads, and on SPanel it&#8217;s set for you at deploy time. Only change it if your workload has a specific need &#8211; for example, you&#8217;re mixing cache data with must-keep data, or you&#8217;ve set TTLs on every key and want eviction confined to them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Q:<\/strong> <strong>Can I change the eviction policy without editing config files?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A:<\/strong> Yes, on platforms that expose it in the panel. ScalaHosting&#8217;s Redis Cache Manager presents the full set of eight policies in a dropdown; you select one, save, and SPanel applies it to your running Redis and restarts the service for you. There&#8217;s no need to edit redis.conf or use the command line.<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n    {\n      \"@context\": \"https:\/\/schema.org\",\n      \"@type\": \"FAQPage\",\n      \"mainEntity\": [{\n        \"@type\": \"Question\",\n        \"name\": \"What is the default Redis eviction policy?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Open-source Redis defaults to noeviction, which evicts nothing and rejects new writes once memory is full. Because that behavior suits a datastore rather than a cache, managed environments typically override it - a fresh Redis deployed through SPanel's Redis Cache Manager uses allkeys-lfu, the better default for application caching.\"\n        }\n      }, {\n        \"@type\": \"Question\",\n        \"name\": \"What happens when Redis runs out of memory?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Redis applies whatever eviction policy you've configured. With an eviction policy like allkeys-lfu, it discards the least-valuable keys to make room and keeps serving requests. With noeviction, it stops accepting writes that need more space and returns an out-of-memory error instead, while reads continue to work.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Is LFU better than LRU for caching?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"For most application caches, yes. LFU (Least Frequently Used) keeps the keys your application accesses most often, which protects genuinely hot data better than LRU (Least Recently Used), which only tracks how recently a key was touched. LRU remains a solid, simpler choice and performs nearly as well in many real-world workloads.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"When not to use allkeys-lfu?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Do not use allkeys-lfu if Redis contains data that cannot be rebuilt. If some keys must never be evicted, use a volatile policy and set TTLs only on disposable cache keys. If no key may be dropped, use noeviction and make sure the application handles write errors.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"When should I use noeviction?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Use noeviction only when you're treating Redis as a store of record rather than a cache - for data that can't be regenerated if it's dropped, such as a persistent counter or a queue. For anything that's genuinely a cache, noeviction is the wrong choice, because rejecting writes is worse than evicting stale keys. Your application must also be written to handle the out-of-memory errors it produces.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Do I need to change the eviction policy myself?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Usually not. allkeys-lfu is the right starting point for the large majority of caching workloads, and on SPanel it's set for you at deploy time. Only change it if your workload has a specific need - for example, you're mixing cache data with must-keep data, or you've set TTLs on every key and want eviction confined to them.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"Can I change the eviction policy without editing config files?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"Yes, on platforms that expose it in the panel. ScalaHosting's Redis Cache Manager presents the full set of eight policies in a dropdown; you select one, save, and SPanel applies it to your running Redis and restarts the service for you. There's no need to edit redis.conf or use the command line.\"\n        }\n      }]\n    }\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Your Redis cache fills up. It always does &#8211; that&#8217;s the point of a memory limit. What happens in the &#8230;<\/p>\n","protected":false},"author":106,"featured_media":74575,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_titles_title":"%%post_title%% %%sep%% %%sitetitle%%","_seopress_titles_desc":"Learn what each Redis eviction policy does, when to use LRU, LFU, volatile, allkeys, or noeviction, and how SPanel lets you change the policy without editing config files.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"","_seopress_redirections_param":"","_seopress_redirections_type":0,"_seopress_analysis_target_kw":"","_seopress_news_disabled":"","_seopress_video_disabled":"","_seopress_video":[],"_seopress_pro_schemas_manual":[],"_seopress_pro_rich_snippets_disable_all":"","_seopress_pro_rich_snippets_disable":[],"_seopress_pro_schemas":[],"footnotes":""},"categories":[125],"tags":[],"class_list":["post-74574","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spanel"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/74574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/users\/106"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/comments?post=74574"}],"version-history":[{"count":2,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/74574\/revisions"}],"predecessor-version":[{"id":74580,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/74574\/revisions\/74580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/media\/74575"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/media?parent=74574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/categories?post=74574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/tags?post=74574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}