当前位置:网站首页>[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
边栏推荐
- Source insight operation manual installation trial
- Simpleitk learning notes
- Deep embedding and alignment of Google | protein sequences
- 32GB Jetson Orin SOM 不能刷机问题排查
- 【无标题】
- 求质数的方法
- Error 1045 (28000) occurs when Linux logs in MySQL: access denied for user 'root' @ 'localhost' (using password: yes)
- Ext4 vs XFS -- which file system should you use
- MySQL startup error: several solutions to the server quit without updating PID file
- Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception
猜你喜欢

Primary school campus IP network broadcasting - Design of primary school IP digital broadcasting system based on campus LAN

Map的扩容机制

How to install and configure altaro VM backup for VMware vSphere

今天很多 CTO 都是被幹掉的,因為他沒有成就業務

PHP notes are super detailed!!!

"C and pointer" - Chapter 13 function pointer 1: callback function 2 (combined with template to simplify code)

mapbox尝鲜值之云图动画
![[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis](/img/df/884313a69fb1e613aec3497800f7ba.jpg)
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis

求质数的方法

@Autowired 导致空指针报错 解决方式
随机推荐
AtCoder Beginner Contest 258(A-D)
mapbox尝鲜值之云图动画
32GB Jetson Orin SOM 不能刷机问题排查
Niuke JS separator
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
Skip table: principle introduction, advantages and disadvantages of skiplist
Redis encountered noauth authentication required
期末复习(DAY6)
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
Making coco datasets
Final review (day3)
MySQL 5.7.32-winx64 installation tutorial (support installing multiple MySQL services on one host)
C 语言文件操作函数大全 (超详细)
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
Mapbox tasting value cloud animation
Configure DTD of XML file
Jetson AgX Orin platform porting ar0233 gw5200 max9295 camera driver
Complete set of C language file operation functions (super detailed)
The request database reported an error: "could not extract resultset; SQL [n/a]; needed exception is org.hibernate.exception.sqlgram"
[untitled]
