redis报Can't save in background: fork: Cannot allocate memory错误

开发那边传过来错误:

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.

查看redis日志:

29300:M 17 Jan 13:50:38.040 * 1 changes in 900 seconds. Saving...
29300:M 17 Jan 13:50:38.040 # Can't save in background: fork: Cannot allocate memory
 

free -g看了下内存,果然没有空间了。

所以:

1、设置最大内存从原来的6G变为4G

2、echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf     sysctl -p

猜你喜欢

转载自blog.csdn.net/baijiu1/article/details/86523076