当前位置:网站首页>Redis aof日志持久化
Redis aof日志持久化
2022-07-28 01:41:00 【yu-yuan】
AOF 工作原理
当你使用Redis做一些事情,都会把你做的事情写到一个文本文件上。
配置:

appendonly 这个是aof日志功能 是否打开 yes

我们在使用AOF是如何在写入速度和数据持久化上,起一个平衡方案,这里可以使用
appendfsync always : 每1个命令都立刻同步到AOF 安全,速度慢
no : 写入工作交给操作系统,由于操作系统判断缓冲区大小,统一写入AOF,同步频率低,速度快。
eveysec : 折衷方案,每秒写一次

no-appendfsync-on-rewrite yes: # 正在导出rdb快照的过程中,要不要停止同步aof
auto-aof-rewrite-percentage 100 #aof文件大小比起上次重写时的大小,增长率100%时,重写
auto-aof-rewrite-min-size 64mb #aof文件,至少超过64M时,重写 (bgrewriteaof 重写命令)
面试常问:
注: 在dump rdb过程中,aof如果停止同步,会不会丢失?
答: 不会,所有的操作缓存在内存的队列里, dump完成后,统一操作.
注: aof重写是指什么?
答: aof重写是指把内存中的数据,逆化成命令,写入到.aof日志里 以解决 aof日志过大的问题.
问: 如果rdb文件,和aof文件都存在,优先用谁来恢复数据?
答: rdb rdb恢复数据快
问: 2种是否可以同时用?
答: 可以,而且推荐这么做
问: 恢复时rdb和aof哪个恢复的快
答: rdb快,因为其是数据的内存映射,直接载入到内存,而aof是命令,需要逐条执行
边栏推荐
- 第三章 队列
- Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance
- mysql 如图所示,现有表a,表b,需求为 通过projectcode关联a、b表,查出address不同的 idcardnum。
- Canonical Address
- 特征值和特征向量
- [TA frost wolf \u may - hundred people plan] Figure 3.7 TP (d) r architecture of mobile terminal
- D multi production single consumption
- Which users are suitable for applying for rapidssl certificate
- 怎么简单实现菜单拖拽排序的功能
- 2022.7.8 supplement of empty Luna
猜你喜欢

Hardware standard

What is eplato cast by Plato farm on elephant swap?

怎么简单实现菜单拖拽排序的功能

【TA-霜狼_may-《百人计划》】图形3.7 移动端TP(D)R架构

Use of Day6 functions and modules

【HCIP】路由策略、策略路由

How is insert locked in MySQL? (glory Collection Edition)

Canonical Address

Learn this trick and never be afraid to let the code collapse by mistake

Notes for the fourth time of first knowing C language
随机推荐
Lombok prompts variable log error when using JUnit test in idea
0动态规划中等 LeetCode873. 最长的斐波那契子序列的长度
[in depth study of 4g/5g/6g topic -42]: urllc-14 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -8-low delay technology-2-slot based scheduling and
Pycharm 快速给整页全部相同名称修改的快捷键
POC模拟攻击利器 —— Nuclei入门(一)
作业7.27 IO进程
Learn this trick and never be afraid to let the code collapse by mistake
2022.7.8 supplement of empty Luna
Flask1.1.4 werkzeug1.0.1 source code analysis: Blueprint
Canvas from getting started to persuading friends to give up (graphic version)
QT implementation disable shortcut key
mysql: error while loading shared libraries: libtinfo.so. 5 solutions
Should programmers choose outsourcing companies
[understanding of opportunity -53]: Yang Mou stands up and plots to defend himself
[TA frost wolf \u may - hundred people plan] Figure 3.7 TP (d) r architecture of mobile terminal
Deep Residual Learning for Image Recognition浅读与实现
POC simulation attack weapon - Introduction to nucleus (I)
Canvas 从入门到劝朋友放弃(图解版)
[brother hero's July training] day 26: check the collection
A 64 bit 8-stage pipelined adder based on FPGA