Today in the program, Jedis put data into the Redis process, "misconf Redis is configured to the save RDB snapshots, but was currently not able-persist on di SK "error;
Then look at the Redis logs and see the error "Can ' t save in Background:fork:Cannot allocate memory", the hint is obvious "the fork process is not enough RAM!" "But there is still more than one g of memory;
After online query, Redis saves data to the hard disk in order to avoid the main process of death, need to fork a master process, and then in the fork process to save the data to the hard disk operation, if the main process uses 4GB of memory, fork sub-process needs additional 4GB, when the memory is not enough, Fork failed, and the data saved the hard drive also failed.
Resolved as follows:
Execute command sysctl Vm.overcommit_memory=1
/etc/sysctl.conf file Additions
Vm.overcommit_memory=1
Redis "Misconf Redis is configured to save RDB snapshots, but was currently not able-persist on disk" issue