当前位置:网站首页>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
边栏推荐
- Istio, ebpf and rsocket Broker: in depth study of service grid
- MySQL binlog cleanup
- Airserver latest win64 bit personal screen projection software
- Jielizhi Bluetooth headset quality control and production skills [chapter]
- The third part of the construction of the defense system of offensive and defensive exercises is the establishment of a practical security system
- plain framework的实际应用和扩展
- What is mosaic?
- 证券开户选哪个证券公司比较好,哪个更安全
- Redis~02 cache: how to ensure data consistency in MySQL and redis when updating data?
- 【无标题】
猜你喜欢

Redis data types and application scenarios

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

从第三次技术革命看企业应用三大开发趋势

有没有一段代码,让你为人类的智慧所折服

Postgresql源码(57)HOT更新为什么性能差距那么大?
![Jielizhi Bluetooth headset quality control and production skills [chapter]](/img/ad/28e7461f8c5dc5c54a3f4da0c111ac.png)
Jielizhi Bluetooth headset quality control and production skills [chapter]

物联网应用技术专业是属于什么类

2022年起重机司机(限桥式起重机)考试试题及模拟考试

Huisheng Huiying 2022 intelligent, fast and simple video editing software

马赛克后挡板是什么?
随机推荐
The third part of the construction of the defense system of offensive and defensive exercises is the establishment of a practical security system
Win 10 mstsc connect RemoteApp
MT manager test skiing Adventure
Daily three questions 6.30
Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration
jpa手写sql,用自定义实体类接收
Create Ca and issue certificate through go language
What are the common types of points mall games?
转行软件测试,知道这四点就够了!
mysql ---- Oracle中的rownum转换成MySQL
plain framework的实际应用和扩展
[applet] realize the left and right [sliding] list through the scroll view component
Daily three questions 6.30 (2)
typescript枚举
Yunxin small class | common cognitive misunderstandings in IM and audio and video
2022年最佳智能家居开源系统:Alexa、Home Assistant、HomeKit生态系统介绍
[micro service sentinel] sentinel integrates openfeign
Concepts of dictionary, hash table and array
“35岁,公司老总,月薪2万送外卖“:时代抛弃你,连声再见都没有
flutter Unable to load asset: assets/images/888.png