首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Linux环境下的Redis管道崩溃

Linux环境下的Redis管道崩溃
EN

Stack Overflow用户
提问于 2019-04-12 08:13:48
回答 1查看 225关注 0票数 1

我正在使用带有Python的芹菜库来并行处理一些相当大的数据集。但是我每天运行的任务,每两到三天中断一次,造成以下错误。

代码语言:javascript
代码运行次数:0
运行
复制
CRITICAL/MainProcess] Unrecoverable error: ResponseError('MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.',)

红宝石原木看起来像

代码语言:javascript
代码运行次数:0
运行
复制
7633:M 12 Apr 07:56:28.284 * 1 changes in 900 seconds. Saving...
7633:M 12 Apr 07:56:28.288 * Background saving started by pid 9530
9530:C 12 Apr 07:56:28.372 * DB saved on disk
9530:C 12 Apr 07:56:28.373 * RDB: 2 MB of memory used by copy-on-write
7633:M 12 Apr 07:56:28.388 * Background saving terminated with success
7633:M 12 Apr 08:01:29.065 * 10 changes in 300 seconds. Saving...
7633:M 12 Apr 08:01:29.065 # Can't save in background: fork: Cannot allocate memory
7633:M 12 Apr 08:01:35.083 * 10 changes in 300 seconds. Saving...
7633:M 12 Apr 08:01:35.088 * Background saving started by pid 9998
9998:C 12 Apr 08:01:35.099 * DB saved on disk
9998:C 12 Apr 08:01:35.101 * RDB: 2 MB of memory used by copy-on-write
7633:M 12 Apr 08:01:35.188 * Background saving terminated with success

相关的系统配置如下

  • Python 3.6
  • 芹菜4.2.1
  • Redis Server和CLI 4.0.9
  • Ubuntu 18.04 (仿生)

有趣的是,完全相同的配置和系统在另一个(开发)服务器上运行良好,另外一个运行Ubuntu16.04。但生产失败了。请注意,我不是芹菜和红葡萄酒方面的专家,只是在谷歌和一些教程之后,代码才开始工作。因此,请尽量将故障排除步骤保持在相对基本的条件下。另外,当我在shell上ping redis-cli时,我得到一个pong作为回报,这意味着服务器正在运行。

EN

回答 1

Stack Overflow用户

发布于 2019-04-12 10:13:38

看起来内存太少了,看到4月12日的日志:“无法在后台保存:叉:无法分配内存”。看起来,当REDIS试图保存快照(更多细节见这里 )时,操作会失败,直到它无法恢复为止。假设您正在使用大型数据集,可能的解决方案可能是:

  1. 如果可能,为不再需要的数据添加过期时间。更多细节这里
  2. 增加你的内存大小,尽管如果你不断地添加数据,它可能会在某个时候爆炸.
  3. 但是,禁用持久性,写入快照的失败很可能是内存不足的副产品。请记住,REDIS可能会删除某些键,这在某些情况下可能不是理想的情况。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55647229

复制
相关文章

相似问题

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