Redis persistent aof and RDB configuration

Source: Internet
Author: User
Tags redis
The AOF saved data scheme is the most complete, if both RDB and aof are turned on, the AoF method is used.

(1) Save rules for setting data to a data file
Save 1 #900秒时间, at least one data update, save to the data file #300秒时间, at least 10 data updates, save to the data file in Save 10000 #60秒时间, at least 10,000 data updates , it is saved to the data file
(2) Data RDB compression settings
Rdbcompression Yes #指定存储至本地数据库时是否压缩数据, the default is Yes,redis with LZF compression, if in order to save CPU time #可以关闭该选项, but will cause the database file flat huge
Dbfilename Dump.rdb #指定rdb保存到本地数据库文件名
Stop-writes-on-bgsave-error Yes #当硬盘因为权限等原因无法写入时, stop writing
Rdbchecksum Yes #对rdb文件进行校验
(3) aof file operation
AppendOnly no #指出是否在每次更新操作后进行日志记录, if not turned on, may result in loss of data over a period of time when power is lost, because the Redis itself synchronizes data files in sync with the save condition above, so some data is #时间内只存在于内存中.
# Appendfsync always: Indicates that each update operation is manually called Fsync () writes data to disk (slow, secure) Appendfsync everysec # everysec: Indicates synchronization once per second (compromise, default Recognition) # Appendfsync No #: Indicates that the data cache of the operating system is synchronized to disk (fast)
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.