当前位置:网站首页>[teacher Zhao Yuqiang] RDB persistence of redis
[teacher Zhao Yuqiang] RDB persistence of redis
2022-07-03 05:45:00 【Teacher zhaoyuqiang】

Redis There are many different levels of persistence :
- RDB Persistence can generate a point in time snapshot of a dataset within a specified time interval (point-in-time snapshot).
- AOF (Append-only file) Persistent records all write commands executed by the server , And when the server starts , Restore the dataset by reexecuting these commands . AOF All commands in the file are as follows Redis The format of the agreement to save , The new command is appended to the end of the file . Redis You can also do it backstage AOF File rewriting (rewrite), bring AOF The size of the file does not exceed the actual size required to save the dataset state .
- Redis It can also be used at the same time AOF Persistence and RDB Persistence . under these circumstances , When Redis Restart time , It will give priority to AOF File to restore the dataset , because AOF The data set saved by a file is usually larger than RDB The data set saved by the file is more complete .
- You can even turn off persistence , Let the data only exist when the server is running .
One 、RDB The persistence of
working principle : Take a snapshot of the memory at regular intervals , Write data in memory to a file (rdb file ). This is a Redis Default persistence method . When redis Generate dump.rdb When you file , The working process is as follows :
- When reach RDB When generating conditions ,redis The main process fork A subprocess
- fork The subprocess will store the data set in memory dump To the temporary RDB in
- When subprocesses are temporary RDB File write complete ,redis With the new RDB The file replaces the old RDB file
The configuration parameters are as follows :

RDB Sample test : have access to redis-benchmark Stress test , Observe RDB Changes in file size .
bin/redis-benchmark -n 100000 Indicates execution 100000 Operations
Two 、RDB The shortcomings of :
Between two snapshots , If a power failure occurs , Data will be lost . give an example : It's generating rdb after , Insert new value . A sudden power failure , Data may be lost .
3、 ... and 、 monitor RDB:
Redis The most direct way to monitor is, of course, to use what the system provides info The order came to do , Just execute the following command , Can get Redis System status report .
bin/redis-cli info | grep rdb_
- rdb_changes_since_last_save Show that last time RDB Save what changes later key frequency
- rdb_bgsave_in_progress Indicates whether or not the current bgsave operation ,1 It means that it is in progress ;0 Indicates that there is no
- rdb_last_save_time Last save RDB The time stamp of the file
- rdb_last_bgsave_time_sec Last saved time
- rdb_last_bgsave_status Last saved state
- rdb_current_bgsave_time_sec It's preserved now RDB Time spent on documents
边栏推荐
- Deep embedding and alignment of Google | protein sequences
- kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
- [explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
- 3dslam with 16 line lidar and octomap
- Crontab command usage
- 【一起上水硕系列】Day 7 内容+Day8
- Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
- [advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
- chromedriver对应版本下载
- Progressive multi grasp detection using grasp path for rgbd images
猜你喜欢

Altaro virtual machine replication failed: "unsupported file type vmgs"

Export the altaro event log to a text file

How does win7 solve the problem that telnet is not an internal or external command

Linux登录MySQL出现ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)

中职网络子网划分例题解析

"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
![Together, Shangshui Shuo series] day 9](/img/39/c1ba1bac82b0ed110f36423263ffd0.png)
Together, Shangshui Shuo series] day 9

@Autowired 导致空指针报错 解决方式

Brief introduction of realsense d435i imaging principle
![[Shangshui Shuo series together] day 10](/img/a3/e8b9df588bef67ead925813a75c8c0.png)
[Shangshui Shuo series together] day 10
随机推荐
Jetson AgX Orin platform porting ar0233 gw5200 max9295 camera driver
获取并监控远程服务器日志
Complete set of C language file operation functions (super detailed)
【无标题】
Map的扩容机制
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
Crontab command usage
Es 2022 officially released! What are the new features?
6.23星期四库作业
Using the ethtool command by example
Life is a process of continuous learning
Apache+PHP+MySQL环境搭建超详细!!!
Explanation of variables, code blocks, constructors, static variables and initialization execution sequence of static code blocks of Ali interview questions
Brief introduction of realsense d435i imaging principle
How to set up altaro offsite server for replication
Sophomore dilemma (resumption)
How does win7 solve the problem that telnet is not an internal or external command
Final review (day3)
Source insight operation manual installation trial
Altaro virtual machine replication failed: "unsupported file type vmgs"
