redis会在一段时间内丢失数据,为什么?
巴扎黑
巴扎黑 2017-04-25 09:02:27
0
4
877

我通过sadd写入set中一些数据,但是过个一两天数据就会丢失?
没有设置logfile,所以日志暂时看不到。
初学redis,还不太懂。

巴扎黑
巴扎黑

reply all(4)
Peter_Zhu

Check if the memory is not enough. If the memory is not enough, redis will recycle the memory. The specific strategy is as follows:
volatile-lru: Select from the data set (server.db[i].expires) with an expiration time set The least recently used data is eliminated
volatile-ttl: Select the data to be expired from the data set (server.db[i].expires) with an expiration time set.
volatile-random: From the data set with an expiration time set (server.db[i].expires) Server.db[i].expires) arbitrarily select data to eliminate
allkeys-lru: Select the least recently used data from the data set (server.db[i].dict) to eliminate
allkeys-random: Select from the data set (server .db[i].dict) to eliminate any selected data
no-enviction (eviction): prohibit the eviction of data

左手右手慢动作

Is certain data lost or all redis data lost?

If it is all, there may be a task to clear redis regularly.
If there is only a part of the data in the set, it may only be deleted manually.

Only the key type has expiration time. Collection no.

Look at the log.

Ty80

There should be an expiration date, I don’t know much about it

伊谢尔伦

http://huangyunbin.iteye.com/blog/1894583

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!