YouTip LogoYouTip

Server Bgrewriteaof

Redis Bgrewriteaof Command

Redis Bgrewriteaof Command

--

Redis Tutorial

Redis Tutorial Redis Introduction Redis Installation Redis Configuration Redis Data Types

Redis Commands

Redis Commands Redis Keys Redis Strings Redis Hashes Redis Lists Redis Sets Redis Sorted Sets Redis HyperLogLog Redis Pub/Sub Redis Transactions Redis Scripting Redis Connection Redis Server Redis GEO Redis Stream

Redis Advanced Tutorial

Redis Backup and Recovery Redis Security Redis Performance Testing Redis Client Connection Redis Pipelining Redis Partitioning Java Using Redis PHP Using Redis Redis Server Redis Bgsave Command

Redis Bgrewriteaof Command

Image 3Redis Server

The Redis BGREWRITEAOF command is used to asynchronously execute an AOF (Append Only File) file rewrite operation. The rewrite will create an optimized version of the current AOF file in terms of size.

Even if BGREWRITEAOF fails, no data will be lost because the old AOF file will not be modified until BGREWRITEAOF succeeds.

Note: Starting from Redis 2.4, AOF rewriting is triggered automatically by Redis, and BGREWRITEAOF is only used to manually trigger the rewrite operation.

Syntax

The basic syntax of the redis BGREWRITEAOF command is as follows:

redis 127.0.0.1:6379> BGREWRITEAOF

Available Versions

>= 1.0.0

Return Value

Feedback information.

Example

redis 127.0.0.1:6379> Background append only file rewriting started
Image 4Redis Server Redis Server Redis Bgsave Command Xunfei Starlight Coding Plan includes free model invocation quota, DeepSe
← Server BgsavePub Sub Psubscribe β†’