当前位置:网站首页>Aof & RDB of J2 redis
Aof & RDB of J2 redis
2022-07-26 19:29:00 【Groundhog breeder】
AOF

Do not block the current command , But it will block the next command , Downtime before logging There is a possibility of loss
Three writeback strategies
AOF appendfsync Three strategies of
- Always, Every time the command is written, it is executed , Write disk immediately ( Basically no data loss , Affect performance )
- Everysec, Write back every second , First write the log to AOF File buffer , Write to disk every second ( One second of data may be missing )
- No Finish the write operation , Put the log into the buffer , The operating system decides when to write ( Good performance , The possibility of losing data is great )

AOF The file will keep getting bigger , Recovery will also be slow , Need AOF Rewrite mechanism ( Save the latest data of key value pairs , There is no need to save old commands )
- AOF Rewriting does not block the main thread , By the background thread bgrewriteaof To complete .
- a copy ( The main thread fork Out bgrewriteaof Subprocesses ), Two logs ( At this time, you can still perform new operations , write in AOF Log and rewrite log cache , The latest operation will not be lost )

RDB
- comparison AOF The recovery is relatively fast , Perform a full backup
- Provide two command generation RDB,save( Main thread execution , It will block ) and bgsave( Child thread write RDB file )
- bgsave When , Through copy on write technology (copy-on-write) Can perform write operations (bgsave By main thread fork Generate , The main thread data can be shared )

Frequent full snapshots can lead to :1. High disk pressure , It's not finished yet Later, I began to do ,2. fork The process will cause blocking of the main thread
Redis 4.0 A mixed use of AOF Log and memory snapshot methods , Use... Between snapshots AOF.
- When data cannot be lost , Memory snapshot and AOF It's a good choice to use a mixture of ;
- If minute level data loss is allowed , You can just use RDB;
- If only AOF, priority of use everysec Configuration options , Because it takes a between reliability and performance
Balance .
边栏推荐
- Without Lin benjian, there would be no TSMC today!
- 3r平衡型理财产品会有风险吗?风险大吗?
- MongoDB stats统计集合占用空间大小
- [swoole series 3.1] have you been asked about processes, threads, and collaborations during the interview?
- 【YOLOv5】--详细版训练自己的数据集 保姆级学习日志记录 手把手教程
- Here comes the most complete introduction to MES system
- conda转移项目虚拟环境必备技能+pip速度下载太慢解决办法
- Advantages of advanced anti DDoS IP in Hong Kong and which industries are suitable for use
- [postgraduate entrance examination vocabulary training camp] day 14 - Panini, predict, access, apologize, sense, transport, aggregation
- Leetcode notes: Weekly contest 303
猜你喜欢

篇7:exited on DESKTOP-DFF5KIK with error code -1073741511.

“蔚来杯“2022牛客暑期多校训练营1

(ICLR-2022)TADA! Time adaptive convolution for video understanding

Distributed transaction Seata

MySQL log introduction

机器学习笔记 - 构建推荐系统(6) 用于协同过滤的 6 种自动编码器

Customer cases | focus on process experience to help bank enterprise app iteration

Data Lake -- concept, characteristics, architecture and case overview

Machine learning notes - building a recommendation system (6) six automatic encoders for collaborative filtering

Network protocol: tcp/ip protocol
随机推荐
Difficult performance problems solved in those years -- ext4 defragmentation
那些年解的疑难性能问题 --- ext4碎片整理
【MySQL必知必会】 日志Log详解
LeetCode笔记:Weekly Contest 303
LeetCode简单题之数组能形成多少数对
C language - Introduction - syntax - string (11)
机器学习笔记 - 构建推荐系统(6) 用于协同过滤的 6 种自动编码器
LeetCode简单题之装满杯子需要的最短总时长
"Weilai Cup" 2022 Niuke summer multi school training camp 2
Leetcode notes: Weekly contest 303
关于接口测试你想知道的都在这儿了
LeetCode简单题之第一个出现两次的字母
LeetCode简单题之验证回文字符串 Ⅱ
"Weilai Cup" 2022 Niuke summer multi school training camp 1
Wechat applet plug-in -- wxml to canvas (generate pictures)
Onion group joined hands with oceanbase to realize distributed upgrading, and global data has achieved cross cloud integration for the first time
How to protect e-commerce websites from network attacks?
当前占位,之后再写
Mongodb stats counts the space occupied by the collection
一些时序建模策略(一)