当前位置:网站首页>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
边栏推荐
- Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
- Experience of practical learning of Silicon Valley products
- 每日三题 6.30(2)
- from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
- 共享电商的背后: 共创、共生、共享、共富,共赢的共富精神
- Linux foundation - centos7 offline installation of MySQL
- 2022 crane driver (limited to bridge crane) examination questions and simulation examination
- 马赛克后挡板是什么?
- flutter Unable to load asset: assets/images/888. png
- 2022 safety officer-c certificate examination question simulation examination question bank and simulation examination
猜你喜欢

win 10 mstsc连接 RemoteApp

Redis AOF日志

CKS CKA ckad change terminal to remote desktop

Glass mosaic

【微服务|Sentinel】sentinel整合openfeign

Wechat personal small store one click opening assistant applet development

物联网开发零基础教程

字典、哈希表、数组的概念

Huisheng Huiying 2022 intelligent, fast and simple video editing software

Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration
随机推荐
[LeetCode] 最后一个单词的长度【58】
JS - use of arguments
Glass mosaic
软件架构的本质
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
ARP报文头部格式和请求流程
神经网络物联网的发展趋势和未来方向
[micro service sentinel] sentinel integrates openfeign
Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
2022 crane driver (limited to bridge crane) examination questions and simulation examination
ShanDong Multi-University Training #3
Yunxin small class | common cognitive misunderstandings in IM and audio and video
物联网技术应用属于什么专业分类
[must] bm41 output the right view of the binary tree [medium +]
typescript枚举
from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
每日三题 6.28
Matplotlib常用設置
硅谷产品实战学习感触
共享电商的背后: 共创、共生、共享、共富,共赢的共富精神