当前位置:网站首页>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
边栏推荐
- 每日三题 6.28
- Leetcode(34)——在排序数组中查找元素的第一个和最后一个位置
- VIM color the catalogue
- ARP报文头部格式和请求流程
- from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
- 距离度量 —— 汉明距离(Hamming Distance)
- 有没有一段代码,让你为人类的智慧所折服
- Postgresql随手记(10)动态执行EXECUTING语法解析过程
- Current situation and future development trend of Internet of things
- Redis AOF日志
猜你喜欢

Huisheng Huiying 2022 intelligent, fast and simple video editing software

为什么PHP叫超文本预处理器

The best smart home open source system in 2022: introduction to Alexa, home assistant and homekit ecosystem

CKS CKA ckad change terminal to remote desktop

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

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

De PIP. Interne. CLI. Main Import main modulenotfounderror: No module named 'PIP'

Notes to problems - file /usr/share/mysql/charsets/readme from install of mysql-server-5.1.73-1 glibc23.x86_ 64 c

Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four

什么是马赛克?
随机推荐
纪念成为首个DAYUs200三方demo贡献者
2021 RoboCom 世界机器人开发者大赛-本科组初赛
Redis 主从同步
Practical application and extension of plain framework
内存泄露和内存溢出的区别是什么?
物联网现状及未来发展趋势
What are the common types of points mall games?
Y53. Chapter III kubernetes from introduction to mastery -- ingress (26)
SWT/ANR问题--SWT 导致 kernel fuse deadlock
How to display real-time 2D map after rviz is opened
Huisheng Huiying 2022 intelligent, fast and simple video editing software
What is mosaic?
CKS CKA ckad change terminal to remote desktop
2022年危险化学品经营单位安全管理人员考试题及在线模拟考试
CADD课程学习(3)-- 靶点药物相互作用
mt管理器测试滑雪大冒险
2022年起重机司机(限桥式起重机)考试试题及模拟考试
2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units
Openresty load balancing
Postgresql源码(58)元组拼接heap_form_tuple剖析