您的位置:首页 > 数据库 > Redis

解决redis Can't save in background: fork: Cannot allocate memory

2015-05-19 02:11 936 查看
前面启动Redis时,看到如下警告:

[1958] 13 Aug 16:18:24 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.


需要修改/etc/sysctl.conf文件:

vim /etc/sysctl.conf


末尾追加vm.overcommit_memory = 1

然后执行sysctl vm.overcommit_memory=1,使之生效:

# sysctl vm.overcommit_memory=1
vm.overcommit_memory = 1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐