Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does redis data phase-out strategy mean?

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

What does the redis data elimination strategy refer to? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!

1. Introduction to phase-out

According to the official warning given by Redis, when memory is insufficient, Redis will phase out some keys according to the configured cache policy to ensure a successful write. When there is no phase-out strategy or no key suitable for phase-out is found, Redis directly returns an out of memory error.

2. Maximum cache configuration

In redis, the maximum memory size that users are allowed to set is 512g.

In redis, it is useful to allow users to set the maximum memory usage server.maxmemory, which is useful when memory is limited. For example, four redis service points are deployed on an 8G machine, each of which allocates 1.5GB of memory to reduce memory strain and obtain more robust services.

3. 6 kinds of data elimination strategies

1. Volatile-lru: select the least used data from the dataset with an expiration time set (server. DB [I]. Obsolete).

2. Volatile-ttl: select the expired data from the dataset (server. DB [I]. Expires) that will expire.

3. Volatile-random: eliminate data from any selected dataset (server. DB [I]. Expires) with an expiration time set.

4. Allkeys-lru: select the least recently used data from the dataset (server.db [I] .dict)

5. Allkeys-random: eliminate data from any selection from the dataset (server. DB [I]. Dict).

6. No-enviction (expulsion): prohibition of expulsion data

4. Suggestions

After understanding the elimination strategy of Redis, you should actively set / update the expire time of key when you use it, and actively eliminate inactive old data, which will help to improve query performance.

Redis expired data elimination refers to the deletion of key-value pairs, please understand!

Thank you for reading! After reading the above, do you have a general understanding of what redis data phase-out strategy refers to? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report