zoukankan      html  css  js  c++  java
  • redis频繁报错Cannot allocate memory

    查看redis日志:

    发现频繁报下面错误

    1285:M 07 Jan 15:10:51.405 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.405 # Can't rewrite append only file in background: fork: Cannot allocate memory
    1285:M 07 Jan 15:10:51.506 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.506 # Can't rewrite append only file in background: fork: Cannot allocate memory
    1285:M 07 Jan 15:10:51.606 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.607 # Can't rewrite append only file in background: fork: Cannot allocate memory
    1285:M 07 Jan 15:10:51.708 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.708 # Can't rewrite append only file in background: fork: Cannot allocate memory
    1285:M 07 Jan 15:10:51.809 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.809 # Can't rewrite append only file in background: fork: Cannot allocate memory
    1285:M 07 Jan 15:10:51.909 * Starting automatic rewriting of AOF on 8959% growth
    1285:M 07 Jan 15:10:51.909 # Can't rewrite append only file in background: fork: Cannot allocate memory

    • 直接修改内核参数 vm.overcommit_memory = 1
    • Redis建议把这个值设置为1, 是为了让fork操作能够在低内存下也执行成功
    • Redis设置合理的maxmemory, 保证机器有20%~30%的闲置内存。
    • 集中化管理AOF重写和RDB的bgsave。·设置vm.overcommit_memory=1, 防止极端情况下会造成fork失败。
  • 相关阅读:
    TF用法指导
    二叉搜索树
    霍夫曼树
    集成学习—boosting和bagging
    值得关注的博客或者文章
    ElasticSearch中的sort排序和filedData作用
    ElasticSearch--validate验证搜索语句是否合法或者存在语法错误
    elasticsearch中query和filter的区别
    深度认识 Sharding-JDBC:做最轻量级的数据库中间层
    elasticserach数据库深度分页查询的原理
  • 原文地址:https://www.cnblogs.com/jiaqili/p/14247033.html
Copyright © 2011-2022 走看看