Home > Database > Redis > body text

What will happen if the redis memory is full?

(*-*)浩
Release: 2019-11-21 09:32:45
Original
4801 people have browsed it

What will happen if the redis memory is full?

#The redis service will crash when the memory is full. According to the officially provided parameters, you can avoid service crashes due to full memory.

Redis only supports a single instance, and the memory is generally up to 10~20GB. (Recommended learning: Redis Video Tutorial )

# Redis Set the MaxMemory parameter of the configuration file, which can control its maximum available memory size (byte).

The property is turned off by default. The default of maxmemory-policy is noeviction

Below I will list the elimination rules for deleting redis keys when the available memory is insufficient.

What will happen if the redis memory is full?But you must pay attention to one thing! Redis does not accurately delete the least recently used key among all keys, but randomly selects 3 keys and deletes the least recently used key among these three keys.

Then the number 3 can also be set, and the corresponding location is maxmeory-samples in the configuration file. This attribute is turned off by default

The background startup settings under Windows are as follows:

Input: redis-server --service-install redis.windows.conf --loglevel verbose (install redis service)

Input: redis-server --service-start (start service )

Input: redis-server --service-stop (stop service)

Start the specified configuration file redis-server --service-start redis.windows-service.conf

The above is the detailed content of What will happen if the redis memory is full?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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