奇怪的redis保存序列和冻结

时间:2018-05-15 12:51:53

标签: redis save

我面临的情况是保存序列几乎每小时都会定期导致redis客户端冻结几分钟。

下面是一个redis.log摘录,展示了冻结服务的奇怪保存序列。请注意,除了第三个序列之外,以下所有序列都正常运行

[5485] 15 May 12:06:43 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:06:43 * Background saving started by pid 2715
[2715] 15 May 12:06:55 * DB saved on disk
[5485] 15 May 12:06:55 * Background saving terminated with success

[5485] 15 May 12:08:44 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:08:44 * Background saving started by pid 2907
[2907] 15 May 12:08:55 * DB saved on disk
[5485] 15 May 12:08:55 * Background saving terminated with success

[5485] 15 May 12:12:59 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:12:59 * Background saving started by pid 3352
[3352] 15 May 12:13:10 * DB saved on disk
[3553] 15 May 12:14:21 * DB saved on disk
[3647] 15 May 12:15:42 * DB saved on disk
[3751] 15 May 12:16:53 * DB saved on disk

[5485] 15 May 12:17:54 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:17:54 * Background saving started by pid 3845
[3845] 15 May 12:18:04 * DB saved on disk
[5485] 15 May 12:18:05 * Background saving terminated with success

[5485] 15 May 12:19:06 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:19:06 * Background saving started by pid 4040
[4040] 15 May 12:19:16 * DB saved on disk
[5485] 15 May 12:19:16 * Background saving terminated with success

更确切地说,如果我们专注于这里的马车序列:

[5485] 15 May 12:12:59 * 10000 changes in 60 seconds. Saving...
[5485] 15 May 12:12:59 * Background saving started by pid 3352
[3352] 15 May 12:13:10 * DB saved on disk
[3553] 15 May 12:14:21 * DB saved on disk
[3647] 15 May 12:15:42 * DB saved on disk
[3751] 15 May 12:16:53 * DB saved on disk

我们看到父进程[5485]成功检测到需要保存,用子进程启动它[3352]。子进程在11秒后声明成功,但父进程不确认它。然后我们可以通过子进程[3553],[3647]和[3751]看到其他3个保存试验。在父进程触发下一次保存之前确认的四个中没有一个被确认。

什么可能导致这种奇怪的行为?

为什么会冻结redis客户端?

非常感谢您的帮助,在我发言时,我们遇到了严重的实际生产问题。

0 个答案:

没有答案