首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将redis配置为缓存

将redis配置为缓存
EN

Stack Overflow用户
提问于 2015-04-03 16:31:36
回答 1查看 349关注 0票数 1

我只想使用redis作为缓存。我必须在redis.conf中禁用哪些选项才能确保这样做。我读到,默认情况下,redis持久化数据(AOF和rdb文件,也许更多)。即使是被设置为期满密钥也是如此。持久化设置为过期的数据不是矛盾的吗?

EN

回答 1

Stack Overflow用户

发布于 2015-04-03 16:44:40

Redis将其所有数据存储在RAM中,但会不时地将其转储到永久存储(HDD/SDD)中。此过程称为快照。

您可以在your redis.conf file中配置快照频率(请参阅SNAPSHOTTING部分):

代码语言:javascript
运行
复制
#   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指令。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29428814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档