我只想使用redis作为缓存。我必须在redis.conf中禁用哪些选项才能确保这样做。我读到,默认情况下,redis持久化数据(AOF和rdb文件,也许更多)。即使是被设置为期满密钥也是如此。持久化设置为过期的数据不是矛盾的吗?
发布于 2015-04-03 16:44:40
Redis将其所有数据存储在RAM中,但会不时地将其转储到永久存储(HDD/SDD)中。此过程称为快照。
您可以在your redis.conf file中配置快照频率(请参阅SNAPSHOTTING部分):
# save <seconds> <changes>
#
# Will save the DB if both the given number of seconds and the given
# number of write operations against the DB occurred.
#
# In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
#
# Note: you can disable saving completely by commenting out all "save" lines.
#
# It is also possible to remove all the previously configured save
# points by adding a save directive with a single empty string argument
# like in the following example:
#
# save ""
save 900 1
save 300 10
save 60 10000因此,如果您希望完全禁用快照,则应该删除或注释redis.conf文件中所有save指令。
https://stackoverflow.com/questions/29428814
复制相似问题