redis 的 AOF 文件 60G 了,我该怎么压缩这个文件呢
服务器上的 AOF 文件 60G,我能通过bgrewriteaof这个命令压缩吗?压缩效果会怎么样?现在 redis 使用内存 7G 。 redis 版本 3.2
服务器上的 AOF 文件 60G,我能通过bgrewriteaof这个命令压缩吗?压缩效果会怎么样?现在 redis 使用内存 7G 。 redis 版本 3.2
Using AOF Redis is much more durable: you can have different fsync policies: no fsync at all, fsync every second, fsync at every query. With the default policy of fsync every second write performances are still great (fsync is performed using a background thread and the main thread will try hard to perform writes when no fsync is in progress.) but you can only lose one second worth of writes.
不会英文 不会读文档,弱点就来了吧,官方说的很清楚了 AOF 你可以选 log 写的机制,而且是后台线程在操作,AOF 并不是事务性的,可能会丢失
https://redis.io/topics/persistence
PS:你的 redis 使用内存 7g,正常来说 aof 文件不会那么大的,感觉像是一直没有触发重写的样子。
你连上命令行,输入:
info Persistence , 回车
贴一下最后面 aof_开头的信息.
磁盘顺序写,基于异步写入响应,我们对单机 redis 的可用性期望是至少 50kqps 起步,加入硬盘响应后就硬盘寻道那速度完全不影响?再说我本来我问的就是数据量超出内存之后的环境,默认肯定在于更新和读取,你扯着个写入不知所云了半天也不知道你在说啥。你的 redis 业务需求就一个写入?就一个 nosql 干起了 tsdb 的活计?
“`
aof_enabled:1
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:44
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
aof_current_size:91520045163
aof_base_size:5035173402
aof_pending_rewrite:0
aof_buffer_length:0
aof_rewrite_buffer_length:0
aof_pending_bio_fsync:0
aof_delayed_fsync:185160
“`