Home > Database > Redis > body text

What is the expiration policy in Redis

PHPz
Release: 2023-05-28 19:13:27
forward
1075 people have browsed it

Expiration strategy of Redis

Redis mainly has two expiration deletion strategies

Lazy deletion

Lazy deletion refers to when we query the key The key is detected only when the expiration time has been reached, and then deleted. Obviously, one of its disadvantages is that if these expired keys are not accessed, they will never be deleted and will continue to occupy memory.

Periodic deletion

Periodic deletion means that redis checks the database every once in a while and deletes the expired keys. Since it is impossible to poll all keys for deletion, redis will randomly select some keys for checking and deletion each time.

The above is the detailed content of What is the expiration policy in Redis. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template