当前位置:网站首页>Redis AOF log
Redis AOF log
2022-07-01 23:27:00 【Mar, LiuNian】
List of articles
Why is the log written after
Because there is no syntax check in the log , Write the log first , Then the wrong command may be written . It's not good for redis Use log recovery
Post writing depends on redis perform , To ensure the correctness of the order
AOF Three kinds of drop mechanism
Drop disk after writing
redis After executing a command , Write a log to disk
Write operations block threads , Influence the follow-up redis Carry out orders
efficiency : low
Downtime It is possible to lose a record
Write every second
redis After executing a command , Write command to AOF Memory buffer
Write the contents of the buffer to the disk every second ( asynchronous )
efficiency : in
Downtime It is possible to lose the log for one second
Operating system controls writeback
redis After executing a command , Write command to AOF Memory buffer
The operating system controls when to write to disk ( asynchronous )
efficiency : high
Downtime It is possible to lose a large number of logs
AOF rewrite
AOF The function of rewriting is to ignore the process , Pay attention to the results ( Anyway, I have nothing to do )
Suppose I have a record A, By 100 The command was modified a hundred times , The end result is 100
here AOF There are records 100 strip , But after rewriting, there is only one
namely A = 100
AOF Rewrite to reduce the log size
Large files are not allowed by the file operating system
The log of large files will affect the writing speed
Logging of large files will affect redis Speed of recovery
AOF Rewrite mechanism
The main thread fork Out bgrewriteaof Subprocesses
bgrewriteaof Middle copy redis Memory data
bgrewriteaof Threads in will reids Memory data + AOF Rewrite buffer data Make up a new AOF To replace the old AOF
stay AOF In the process of rewriting , old AOF Still writing normally , To deal with the downtime problem when the rewrite is not completed

AOF Rewriting will affect the main thread
1. The main thread will be blocked when the child process copies data
2. When the main thread operates on existing data , It will also block
The parent-child process copies data using write time replication
Only the necessary data structures are copied in the subprocess
The child process and the parent process point to the same memory space
When the parent process writes , Will allocate a new memory address , Copy the data in
边栏推荐
- Practical application and extension of plain framework
- Redis 主从同步
- The digital summit is popular, and city chain technology has triggered a new round of business transformation
- flutter Unable to load asset: assets/images/888. png
- MySQL -- convert rownum in Oracle to MySQL
- Create Ca and issue certificate through go language
- Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
- 图的遍历之深度优先搜索和广度优先搜索
- 物联网技术应用属于什么专业分类
- Daily three questions 6.28
猜你喜欢

距离度量 —— 汉明距离(Hamming Distance)

notBlank 和 notEmpty

2022 safety officer-c certificate examination question simulation examination question bank and simulation examination

纪念成为首个DAYUs200三方demo贡献者

Matplotlib common charts

flutter Unable to load asset: assets/images/888.png

2022年R1快开门式压力容器操作考题及答案
![[must] bm41 output the right view of the binary tree [medium +]](/img/a5/00b2f0df5ab448665a2b062d145e52.png)
[must] bm41 output the right view of the binary tree [medium +]

2021 RoboCom 世界机器人开发者大赛-高职组初赛

Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
随机推荐
距离度量 —— 汉明距离(Hamming Distance)
Behind sharing e-commerce: the spirit of CO creation, symbiosis, sharing, CO prosperity and win-win
2021 RoboCom 世界机器人开发者大赛-高职组初赛
JS - use of arguments
【小程序】通过scroll-view组件实现左右【滑动】列表
Which securities company is better and which is safer to open a securities account
MT manager test skiing Adventure
Postgresql源码(58)元组拼接heap_form_tuple剖析
Development trend and future direction of neural network Internet of things
CKS CKA ckad change terminal to remote desktop
Notes to problems - file /usr/share/mysql/charsets/readme from install of mysql-server-5.1.73-1 glibc23.x86_ 64 c
Daily three questions 6.30 (2)
【微服务|Sentinel】sentinel整合openfeign
Linux foundation - centos7 offline installation of MySQL
Microservice stability management
纪念成为首个DAYUs200三方demo贡献者
Redis~02 缓存:更新数据时如何保证MySQL和Redis中的数据一致性?
2022 R1 fast opening pressure vessel operation test questions and answers
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
SWT/ANR问题--SWT 导致 kernel fuse deadlock