Redis persistence-RDB working principle and problems, redis-rdb

Source: Internet
Author: User

Redis persistence-RDB working principle and problems, redis-rdb

Working principle of Redis persistent RDB mode:

Redis persistent RDB mode. Redis uses the copy on write mechanism of the fork command. When a snapshot is generated, the current process is completely copied, fork generates a sub-process, and then all the data is recycled in the sub-process to write the data into an RDB file.

 

Problems caused by Redis persistent RDB:

In RDB mode, the memory occupied by the Redis service is doubled.

For example, if a machine has 16 GB of memory and uses 10 Gb of memory for Redis service, if the 10 Gb memory is full

Run the save command. Then, the 10G process will be copied again and changed to 20G. If the process exceeds 16G, an exchange will be generated,

If the virtual memory is set to 4 GB, the save operation can also be completed, resulting in a large number of exchanges, which will be very slow;

If the virtual memory is set to less than 4 GB, Redis will crash and the data will not be completely saved to the snapshot file,

After restarting, you will find that the data has been lost.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.