Redis configuration file append only file (AOF) section---data persistence

Source: Internet
Author: User

############################## only Append mode ###############################

#默认情况下Redis会异步的将数据导出到磁盘上. This pattern is sufficient for many applications,
#但是如果断电或者redis进程出问题就会导致一段时间内的更新数据丢失 (depending on the configuration item)
#
#这种只增文件是可选的能够提供更好的体验的数据持久化策略.
#举个例子, if the default configuration data Fsync policy is used, Redis loses only one second of the updated data in the event of an unexpected server power outage.
#或者当redis进程出问题但操作系统运转正常时, Redis will only lose one data update operation.
#
The #AOF and RDB persistence mode can be started at the same time without conflicts.
#如果AOF开启, aof files are loaded when Redis is started, and these files provide better assurance.
#请在 http://redis.io/topics/persistence For more data persistence information.

AppendOnly No

# only the file name of the file is added. (Default is Appendonly.aof)
# Appendfilename Appendonly.aof

The #调用fsync () function tells the operating system to actually write data to disk, rather than waiting for more data in the buffer.
#有些操作系统会将数据输出到磁盘, some operating systems are just ASAP.
#
#redis支持三种不同的方式:
#
#no: Do not call, wait for the operating system to empty the buffer when the operating system wants to output data. Soon.
# always: Each update data is written to only the add-in log file. Slow, but most secure.
# Everysec: Called once per second. Compromise.
#
#默认是每秒中一次, as it is often a compromise between speed and data security.
#如果你可以接受让操作系统去自动清空缓存, you can reduce this configuration to ' no ' (if you can accept data loss for a period of time, the default rdb is sufficient),
#这完全取决与你. If you want a better experience or use ' always ' from the opposite angle, it will be slow, but safer than ' everysec '.
#
#请在下面的文章中获取更多细节知识:
# http://antirez.com/post/redis-persistence-demystified.html
#
#如果你不是很清楚这三项之间的区别, or don't know which machine is right for you, just use the default.

# Appendfsync Always
Appendfsync always
# Appendfsync No

#当AOF策略设置为 ' always ' or ' everysec ', the background save process will perform many disk I/O operations,
The #在某些linux结构中redis会在调用sync () method is blocked for a long time. Remember, there is no way to solve this problem, even if it is called in a different process.
#
#使用如下配置可能会缓解这个问题, this will not call the Fsync () method in the main process when storing big data or bigrewriteaof.
#
# This means that if another child process is doing a save operation, Redis behaves as if it were configured as ' Appendfsync no '.
#在实际应用中, this means that in the worst scenario (using the Linux default configuration) a 30-second log may be lost.
#
#如果你有特殊的情况可以配置为 ' yes '. But configured as ' no ' is the safest option.
No-appendfsync-on-rewrite No


#自动重写只增文件.
#redis可以自动盲从的调用 ' bgrewriteaof ' to rewrite the log file if the log file grows by a specified percentage.
#
#它是这样工作的: Redis logs the size of the log file after each rewrite. (The log file size is the default if no rewritten size after reboot)
#
# This benchmark log size is compared with the current log size. If the current size is greater than the specified percentage, the override mechanism is triggered.
#同时, you also have to develop a rewrite downline to avoid the growth percentage enough, but the log file is still small.
#
#指定百分比为0可以注掉自动重写日志文件功能.

Auto-aof-rewrite-percentage 100
Auto-aof-rewrite-min-size 64MB

Redis configuration file append only file (AOF) section---data persistence

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.