Files
doc-exports/docs/dcs/umn/dcs-faq-0730022.html
Chen, Junjie 748ac2c008 DCS UMN 20230811 version
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2024-01-24 14:13:13 +00:00

20 lines
4.3 KiB
HTML

<a name="dcs-faq-0730022"></a><a name="dcs-faq-0730022"></a>
<h1 class="topictitle1">What Is the Default Data Eviction Policy?</h1>
<div id="body1596093268950"><p id="dcs-faq-0730022__en-us_topic_0152099097_p891453012313">Data is evicted from cache based on a user-defined space limit in order to make space for new data. For details, see the <a href="https://redis.io/topics/lru-cache?spm=a2c4g.11186623.2.2.7a465a76HeE7QM" target="_blank" rel="noopener noreferrer">Redis official website</a>. You can <a href="#dcs-faq-0730022__section2022722111124">view or change the eviction policy</a> by configuring an instance parameter on the DCS console.</p>
<div class="section" id="dcs-faq-0730022__section16380812182515"><h4 class="sectiontitle">Eviction Policies Supported by DCS Redis Instances</h4><p id="dcs-faq-0730022__en-us_topic_0152099097_p24119933153714">When <strong id="dcs-faq-0730022__b9411301292">maxmemory</strong> is reached, you can select one of the following eight eviction policies:</p>
<ul id="dcs-faq-0730022__ul63511053153341"><li id="dcs-faq-0730022__li46713159155023"><strong id="dcs-faq-0730022__b148525218919">noeviction</strong>: When the memory limit is reached, DCS instances return errors to clients and no longer process write requests and other requests that could result in more memory to be used. However, <strong id="dcs-faq-0730022__b23887235114">DEL</strong> and a few more exception requests can continue to be processed.</li><li id="dcs-faq-0730022__li33146435153341"><strong id="dcs-faq-0730022__b12386224217">allkeys-lru</strong>: DCS instances try to evict the least recently used keys first, in order to make space for new data.</li><li id="dcs-faq-0730022__li62982494153346"><strong id="dcs-faq-0730022__b1523412252113">volatile-lru</strong>: DCS instances try to evict the least recently used keys with an expire set first, in order to make space for new data.</li><li id="dcs-faq-0730022__li61473187153348"><strong id="dcs-faq-0730022__b9967425718">allkeys-random</strong>: DCS instances recycle random keys so that new data can be stored.</li><li id="dcs-faq-0730022__li9870151153350"><strong id="dcs-faq-0730022__b15787152616119">volatile-random</strong>: DCS instances evict random keys with an expire set, in order to make space for new data.</li><li id="dcs-faq-0730022__li3073190415343"><strong id="dcs-faq-0730022__b989313618914">volatile-ttl</strong>: DCS instances evict keys with an expire set, and try to evict keys with a shorter time to live (TTL) first, in order to make space for new data.</li><li id="dcs-faq-0730022__li1918134611344"><strong id="dcs-faq-0730022__b188119815917">allkeys-lfu</strong>: DCS instances evict the least frequently used keys from all keys.</li><li id="dcs-faq-0730022__li188701956123617"><strong id="dcs-faq-0730022__b12439131113918">volatile-lfu</strong>: DCS instances evict the least frequently used keys with an <strong id="dcs-faq-0730022__b1944015111698">expire</strong> field from all keys.</li></ul>
<div class="note" id="dcs-faq-0730022__en-us_topic_0152099097_note33192730155638"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="dcs-faq-0730022__en-us_topic_0152099097_p30299119155638">If no key can be recycled, <strong id="dcs-faq-0730022__b122631228518">volatile-lru</strong>, <strong id="dcs-faq-0730022__b626410282110">volatile-random</strong>, and <strong id="dcs-faq-0730022__b62641528915">volatile-ttl</strong> are the same as <strong id="dcs-faq-0730022__b1526417284111">noeviction</strong>. For details, see the description of <strong id="dcs-faq-0730022__b42649283119">noeviction</strong>.</p>
</div></div>
</div>
<div class="section" id="dcs-faq-0730022__section2022722111124"><a name="dcs-faq-0730022__section2022722111124"></a><a name="section2022722111124"></a><h4 class="sectiontitle">Viewing or Changing Eviction Policies</h4><p id="dcs-faq-0730022__p84517544616">You can view or change the eviction policy with the <strong id="dcs-faq-0730022__b102391735142717">maxmemory-policy</strong> parameter.</p>
<p id="dcs-faq-0730022__p114731557171317"><span><img id="dcs-faq-0730022__image9472145713132" src="en-us_image_0000001591550122.png"></span></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-faq-0326021.html">Redis Usage</a></div>
</div>
</div>