#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.
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!