REdis Asynchronous AOF fsync is taking too long
redis.conf中的no-appendfsync-on-rewrite
默认值为no,表示在重写AOF文件或RDB文件时阻塞fsync。
如果重写AOF或RDB文件时长过长,则在日志中可以看到如下信息:
Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
严重时会导致该节点被判断为fail,从而触发主从切换,建议尽可能将配置项“appendfsync”的值设置为“no”。
相关源代码(以REdis-5.0.4为例):
void flushAppendOnlyFile(int force) { // aof.c:331
。。。。。。
/* Don't fsync if no-appendfsync-on-rewrite
* is set to yes and there are
* children doing I/O in the background. */
// no-appendfsync-on-rewrite值为yes,
// 并且存在AOF或RDB进程时,直接返回而不调用fsync。
if (server.aof_no_fsync_on_rewrite &&
(server.aof_child_pid != -1 ||
server.rdb_child_pid != -1))
return;
。。。。。。
}
int rewriteAppendOnlyFileBackground() { // aof.c:1532
。。。。。。
childpid = fork();
。。。。。。
server.aof_child_pid = childpid;
。。。。。。
}
int rdbSaveBackground( // rdb.c:1282
char *filename,
rdbSaveInfo *rsi) {
。。。。。。
childpid = fork();
。。。。。。
server.rdb_child_pid = childpid;
。。。。。。
}
22301:M 19 Apr 2019 20:49:39.391 * Starting automatic rewriting of AOF on 100% growth
22301:M 19 Apr 2019 20:49:39.520 * Background append only file rewriting started by pid 38549
22301:M 19 Apr 2019 20:49:59.080 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
22301:M 19 Apr 2019 20:50:32.008 * Background AOF buffer size: 80 MB
22301:M 19 Apr 2019 20:50:47.406 * AOF rewrite child asks to stop sending diffs.
38549:C 19 Apr 2019 20:50:47.406 * Parent agreed to stop sending diffs. Finalizing AOF...
38549:C 19 Apr 2019 20:50:47.406 * Concatenating 647.71 MB of AOF diff received from parent.
38549:C 19 Apr 2019 20:50:53.097 * SYNC append only file rewrite performed
38549:C 19 Apr 2019 20:50:53.248 * AOF rewrite: 3998 MB of memory used by copy-on-write
22301:M 19 Apr 2019 20:50:53.975 * Background AOF rewrite terminated with success
22301:M 19 Apr 2019 20:50:54.030 * Residual parent diff successfully flushed to the rewritten AOF (69.97 MB)
22301:M 19 Apr 2019 20:50:54.214 * Background AOF rewrite finished successfully
22301:M 19 Apr 2019 20:51:30.085 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
22301:M 19 Apr 2019 20:51:54.071 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
22301:M 19 Apr 2019 20:52:23.040 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
22301:M 19 Apr 2019 20:53:12.043 * Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.
22301:M 19 Apr 2019 20:55:06.226 * Marking node 720a9ead7beb61042fd56a873deec6b2cb0daec5 as failing (quorum reached).
22301:M 19 Apr 2019 20:55:06.226 # Cluster state changed: fail
22301:M 19 Apr 2019 20:55:38.186 * Clear FAIL state for node 720a9ead7beb61042fd56a873deec6b2cb0daec5: is reachable again and nobody is serving its slots after some time.
22301:M 19 Apr 2019 20:55:38.186 # Cluster state changed: ok
22301:M 19 Apr 2019 20:55:44.322 * FAIL message received from 252b3bb2f902bc81926c8ae04b6eefa8c3133bd4 about 1d5315824f9ce14f3076ff04c7330590b942efb8
22301:M 19 Apr 2019 20:55:44.322 # Cluster state changed: fail
REdis Asynchronous AOF fsync is taking too long的更多相关文章
- redis 持久化 AOF和 RDB 引起的生产故障
概要 最近听开发的同事说,应用程序连接 redis 时总是抛出连接失败或超时之类的错误.通过观察在 redis 日志,发现日志中出现 "Asynchronous AOF fsyn ...
- Redis的AOF功能
引言: Redis是基于内存的数据库,同时也提供了若干持久化的方案,允许用户把内存中的数据,写入本地文件系统,以备下次重启或者当机之后继续使用.本文将描述如何基于Redis来设置AOF功能 什么是R ...
- Redis开启AOF导致的删库事件
事件背景 Redis主从开启AOF,错误操作导致数据被清空. Redis主要作用:缓存.队列. 事故过程 Redis搭建了主从,持久化方式为RDB,RDB没有定时备份,且AOF都没有开启. 考虑到开启 ...
- Redis持久化——AOF(二)
核心知识点: 1.AOF:以独立日志的方式记录写命令,重启时再执行命令.与RDB不同的是解决数据持久化的实时性,可以记录所有写操作. 2.AOF工作流程:写入命令.文件同步.文件重写.文件加载. 3. ...
- Redis持久化——AOF日志
最新:Redis内存--内存消耗(内存都去哪了?) 最新:Redis持久化--如何选择合适的持久化方式 最新:Redis持久化--AOF日志 更多文章... 上一篇文章Redis持久化--内存快照(R ...
- Redis - 持久化 AOF 和 RDB
Redis - 持久化 AOF 和 RDB AOF AOF 持久化记录服务器执行的所有写操作命令,并在服务器启动时,通过重新执行这些命令来还原数据集. AOF 文件中的命令全部以 Redis 协议的格 ...
- 一文了解:Redis的AOF持久化
Redis的AOF持久化 每当Redis-Server接收到写数据时,就把命令以文本形式追加到AOF文件里,当重启Redis服务时,AOF文件里的命令会被重新执行一次,重新恢复数据.当AOF过大时将重 ...
- redis 配置文件aof配置
redis 配置文件aof配置: bind 127.0.0.1 port 6379 daemonize yes dbfilename dump.rdb dir /new_renpeng/redis/ ...
- redis 开启AOF 持久化
redis 开启AOF 找到redis 安装目录 打开 redis.conf 修改以下参数: appendonly yes (默认no,关闭)表示是否开启AOF持久化: append ...
随机推荐
- LinkedHashMap 根据PUT顺序排序Map
最近工程里面报表需要合计 , 因为所有的项都是动态的,所以只能动态添加. 思路是使用Map,初始化所有Map,然后在Map中合计并且覆盖. 使用HashMap , 初始化后所有动态项的顺序都乱了. M ...
- EOS源码
[EOS源码] 1.在 libraries/chain/include/eosio/chain/ 目录下. permission_level 定义如下: account_name.permissi ...
- 【CPU微架构设计】利用Verilog设计基于饱和计数器和BTB的分支预测器
在基于流水线(pipeline)的微处理器中,分支预测单元(Branch Predictor Unit)是一个重要的功能部件,它负责收集和分析分支/跳转指令的执行结果,当处理后续分支/跳转指令时,BP ...
- 字节、字、bit、Byte、byte的关系区分
1.位(bit) 来自英文bit,音译为"比特", 表示二进制位.位是计算机内部数据存储最小单位,11010100是一个8位二进制数.一个二进制位只可以表示 ...
- mybatis出现无效的列类型
package com.webapp.hanqi.test; import java.util.Date; import org.junit.jupiter.api.AfterEach; import ...
- python异常捕捉以及处理
看标题觉得高大上,好像能处理所有的异常.但是,事实是只能按照字面的意思来理解这一段话. 众所周知写代码哪有不出bug的? 那么出现了bug 我们不想让程序因为bug的存在而退出.那么要怎么做呢? 今天 ...
- 从零开始学spring cloud(八) -------- Eureka 高可用机制
一.Eureka高可用机制介绍 Eureka服务器没有后端存储,但注册表中的服务实例都必须发送心跳以使其注册保持最新(因此可以在内存中完成). 客户端还有一个Eureka注册的内存缓存(因此,他们不必 ...
- python基础 ------ 集合
---恢复内容开始--- ----- 集合 使用场景:网购的订单.与商品ID 一一对应的商品信息 python的内置类型:List Tuple Dictionary ---- 列表 LI ...
- vs code 配置 php xdebug
1.安装扩展 php debug 2.下载xdebug插件 做个页面输出phpinfo(),复制到这个页面 https://xdebug.org/wizard.php 提交后会告诉你机子要下载哪个版本 ...
- windows server 2012 远程桌面不好使
下面的文章里讲的比较详细 http://www.hfkehu.cn/thread-4382-1-1.html 我遇到的问题是第一种,因为是刚装的机器,刚连上网时,选择如下设置时,因为鼠标一点别的地方, ...