The persistence of Redis

Source: Internet
Author: User

Workflow for RDB:

1. Executing the bgsave command, the Redis parent process determines whether a child process is currently executing, such as a rdb/aof child process, if there is a bgsave command to return directly.

2. The parent process performs the fork operation to create the child process, and the parent process is blocked during the fork operation.

3. After the parent process fork is finished, the Bgsave command returns the "* Background saving started by PID XXX" message and no longer blocks the parent process and can continue to respond to other commands.

4. The parent process creates an RDB file, generates a temporary snapshot file based on the parent process memory, and then atomically replaces the original file after completion. Depending on the Lastsave command, you can obtain the last time the RDB was generated, corresponding to the rdb_last_save_time in info persistence.

5. The process sends a signal to the parent process for a victory, and the parent process updates the statistics.

The persistence of Redis

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.