Why does Redis set maxmemory?

set it. If you exceed it, you will OOM. You might as well not set it at all.

Jul.08,2022

wait to be dropped by the system kill without setting?


Redis cache is not data storage, Redis cache is to avoid a large number of data reading and writing falling on the hard disk and caching hot data, so data applications that are not available on redis should be read on disk. Setting the maximum memory has two advantages: one is to avoid crashing when system resources are exhausted, but too much memory will inevitably affect efficiency such as memory management.

in addition, the maximum memory is set, and when the data you want to cache is larger than the maximum memory, it will not cause OOM,Redis to eliminate data that he does not think will be a hot spot according to the elimination algorithm.


the maximum memory setting is more considered as a cache scenario, that is, limit the maximum cache
should be used with policies, such as discarding data according to various policies after the limit is exceeded, or default kill
reference here


it is better to limit

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc8de3-3017b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc8de3-3017b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?