How Redis persistent RDB mode works:
Redis Persistent RDB mode,Redis with the copy on write mechanism of the fork command. When the snapshot is generated, the entire current process is copied out, fork out a subprocess, and then loop through all the data in the child process, writing the data to an RDB file.
Redis Persistent RDB mode issues that are raised:
RDB mode requires 1 time times as much memory as the Redis service takes up
For example, a machine with a total of 16G of memory, using 10G of memory to do Redis service, if this 10G of memory is fully occupied
Then run the Save command, then the 10G process will be copied again, into 20G, more than 16G to generate exchange,
If the virtual memory is set to 4G, so save can also be completed, due to trigger a large number of exchanges, will be very slow;
If the virtual memory is set to less than 4G, Redis crashes and the data is not fully saved to the snapshot file.
Restart, you will find that the data has been lost a lot.
How Redis's persistent--rdb works and issues that arise