This article will take you to understand AOF in Redis persistence, introduce the principle of AOF, and the shortcomings of AOF. I hope it will be helpful to everyone!
Redis above One of the persistence methods in
is RDB
In this article, we will talk about another implementation method, which is AOF
AOF
is an appended log file that only records Redis
write commands
##AOF The log is stored in
sequential instructions, so after Redis goes down, the purpose of data recovery can be achieved by "retracing the old path" internally
Redis Video Tutorial】
AOF
file.
needs to call the fsync
function provided by Linux
in real time to transfer the specified file from the kernel every time The cache is written to disk
function by changing the configuration parameters
So
First of all, because many
So create a sub-process to traverse the memory
We can use the command below to enable rewriting, of course, it can also be set to automatically execute
##Traversing the entire memory each time will bring a lot of additional performance overhead to the systemEach data recovery is a long process and each time it is written from the kernel to the disk It consumes IO performance
For more programming-related knowledge, please visit:
Introduction to ProgrammingThe above is the detailed content of A brief analysis of the principles and shortcomings of AOF in Redis. For more information, please follow other related articles on the PHP Chinese website!