Redis Persistent Configuration

Source: Internet
Author: User

Redis Persistent Configuration

There are 2 ways to persist Redis 1 snapshot 2 is log

configuration options for Rdb snapshots

Save 1//within the range of 1 writes , a snapshot is generated

Save +// if There are more than five writes in a second , a snapshot is generated

Save 10000// if There are 10000 writes in a second , a snapshot is generated

( these 3 options are masked , the rdb is disabled )

Stop-writes-on-bgsave-error Yes// background backup process error , does the main process stop writing ?

Rdbcompression Yes// the exported rdb file is compressed

Rdbchecksum Yes// import RBD when restoring data , do not verify The integrity of the RDB

Dbfilename Dump.rdb//The rdb filename of the guide

Dir.///rdb Placement Path

configuration of the Aof

AppendOnly No # whether to turn on the aof log feature, to disable AOF set to No and rename the AoF file

Appendfsync always # every 1 commands , sync to aof immediately. Safety , Slow Speed

Appendfsync everysec # compromise, write 1 times per second

Appendfsync No # writes to the operating system , determines the buffer size by the operating system , and writes uniformly to the aof. Low Synchronization frequency , Fast Speed ,

No-appendfsync-on-rewrite Yes: # in the process of exporting an RDB snapshot , either stop synchronizing aof

Auto-aof-rewrite-percentage #aof File size compared to the size of the last rewrite , when the growth rate 100% , rewrite

Auto-aof-rewrite-min-size 64mb #aof file , at least 64M , override

Note : In the dump RDB process , if the aof stop synchronization , will not be lost ?

A: no , All operations are cached in the memory queue , and after the dump is complete , The operation is unified .

Note : What does aof rewrite mean ?

A: aof rewrite refers to the memory of the data , the inverse of the command , written to the . aof log .

to resolve The problem that the AOF log is too large .

q : if the rdb file , and the aof file are present , Who will be the first to recover the data ?

answer : aof

q : can 2 types be used at the same time ?

A: yes , and recommend it.

q : Which of the rdb and aof recovers quickly when recovering

A: The RDB is fast because it is a memory map of the data , loaded directly into memory , and aof It's an order , it needs to be executed

Redis Persistent Configuration

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.