首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“60秒内的10000变化”仅每3分钟运行一次。

“60秒内的10000变化”仅每3分钟运行一次。
EN

Stack Overflow用户
提问于 2016-01-07 09:48:59
回答 2查看 7.1K关注 0票数 3

我在调查我们系统中的红宝石记忆问题。

我正在努力弄清楚所做的10000项改变是什么(在我看来太多了)

奇怪的是,我得到的10000 changes in 60 seconds. Saving...,但每3分钟,而不是60秒,正如我所期望的。

日志样本:

代码语言:javascript
复制
[10993] 03 Jan 06:37:46.166 * 10000 changes in 60 seconds. Saving...
[10993] 03 Jan 06:37:46.167 * Background saving started by pid 4802
[4802] 03 Jan 06:37:46.170 * DB saved on disk
[4802] 03 Jan 06:37:46.170 * RDB: 2 MB of memory used by copy-on-write
[10993] 03 Jan 06:37:46.268 * Background saving terminated with success
[10993] 03 Jan 06:40:27.140 * 10000 changes in 60 seconds. Saving...
[10993] 03 Jan 06:40:27.141 * Background saving started by pid 5081
[5081] 03 Jan 06:40:27.145 * DB saved on disk
[5081] 03 Jan 06:40:27.145 * RDB: 2 MB of memory used by copy-on-write
[10993] 03 Jan 06:40:27.242 * Background saving terminated with success
[10993] 03 Jan 06:43:08.335 * 10000 changes in 60 seconds. Saving...

redis_version:2.8.4

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-01-07 18:22:10

save 60 10000在您的配置中意味着,redis定期检查是否有至少10000次更改,,它的是,至少是,从上次rdb保存开始60秒。只有在满足这两种条件(对于任何一个保存点)的情况下,才能启动新的rdb保存。

此外,如果您认为~3分钟内的10000次更改听起来很大,请不要忘记,一个命令可以将更改计数增加一个以上,例如MSET

票数 4
EN

Stack Overflow用户

发布于 2018-03-23 11:52:24

这是从redis.conf文件中复制的,它解释了一切。

代码语言:javascript
复制
################################ SNAPSHOTTING  ################################
#
# Save the DB on disk:
#
#   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

如果要查看所有活动,请使用命令monitor

代码语言:javascript
复制
$ redis-cli monitor
1339518083.107412 [0 127.0.0.1:60866] "keys" "*"
1339518087.877697 [0 127.0.0.1:60866] "dbsize"
1339518090.420270 [0 127.0.0.1:60866] "set" "x" "6"
1339518096.506257 [0 127.0.0.1:60866] "get" "x"
1339518099.363765 [0 127.0.0.1:60866] "del" "x"
1339518100.544926 [0 127.0.0.1:60866] "get" "x"
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34651964

复制
相关文章

相似问题

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