输入banner图图片脚本导航/分类

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk

  •   
  • To have if after reboot add this line to /etc/sysctl.cnf:  
  •   
  • vm.overcommit_memory=1  
  • 修改vm.overcommit_memory=1后问题果然解决了。

    为什么系统明明还剩2GB的内存,Redis会说内存不够呢?

    网上查了一下,有人也遇到类似的问题,并且给出了很好的分析(详见:http://www.linuxidc.com/Linux/2012-07/66079.htm),简单地说:Redis在保存数据到硬盘时为了避免主进程假死,需要Fork一份主进程,然后在Fork进程内完成数据保存到硬盘的操作,如果主进程使用了4GB的内存,Fork子进程的时候需要额外的4GB,此时内存就不够了,Fork失败,进而数据保存硬盘也失败了。

    MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk

    标签:一个   左右   database   bigger   under   存储   inux   enable   避免