当前位置:网站首页>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
边栏推荐
- Oracle中已定义者身份执行函数AUTHID DEFINER与Postgresql行为的异同
- Development trend and future direction of neural network Internet of things
- Concepts of dictionary, hash table and array
- The digital summit is popular, and city chain technology has triggered a new round of business transformation
- Redis数据类型和应用场景
- 云信小课堂 | IM及音视频中常见的认知误区
- 常见的积分商城游戏类型有哪些?
- Yunxin small class | common cognitive misunderstandings in IM and audio and video
- 字典、哈希表、数组的概念
- Jielizhi Bluetooth headset quality control and production skills [chapter]
猜你喜欢
【小程序】通过scroll-view组件实现左右【滑动】列表
CADD课程学习(3)-- 靶点药物相互作用
问题随记 —— /usr/bin/perl is needed by MySQL-server-5.1.73-1.glibc23.x86_64
为什么PHP叫超文本预处理器
Future trend and development of neural network Internet of things
神经网络物联网的发展趋势和未来方向
会声会影2022智能、快速、简单的视频剪辑软件
ARP报文头部格式和请求流程
2022年最佳智能家居开源系统:Alexa、Home Assistant、HomeKit生态系统介绍
STM32F030F4驱动TIM1637数码管芯片
随机推荐
Understanding threads
[must] bm41 output the right view of the binary tree [medium +]
The online beggar function of Japanese shopping websites
为什么PHP叫超文本预处理器
常见的积分商城游戏类型有哪些?
Wechat personal small store one click opening assistant applet development
【微服务|Sentinel】@SentinelResource详解
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
Anomaly-Transformer (ICLR 2022 Spotlight)复现过程及问题
会声会影2022智能、快速、简单的视频剪辑软件
2022 crane driver (limited to bridge crane) examination questions and simulation examination
What is mosaic?
Applet form verification encapsulation
Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
有没有一段代码,让你为人类的智慧所折服
Glass mosaic
图的遍历之深度优先搜索和广度优先搜索
神经网络物联网的未来趋势与发展
ShanDong Multi-University Training #3
认识线程