mysql 错误等级_Mysql5.7 的错误日志中最常见的note级别日志解释
在使用mysql5.7的时候,发现了不少在mysql5.6上不曾见过的日志,级别为note, 作者梳理了一下,最常见的note日志以下三种,下面我们来逐个解释。
第一种,Aborted connection . 如上图,信息如下:
2016-03-17T14:44:24.102542Z 59 [Note] Aborted connection 59 to db: ‘unconnected’ user: ‘mha’ host: ‘197.xx.xx.xx’ (Got an error reading communication packets)
2016-03-17T14:44:31.273897Z 61 [Note] Aborted connection 61 to db: ‘unconnected’ user: ‘mha’ host: ‘197.xx.xx.xx(Got an error reading communication packets)
2016-03-17T14:44:31.273897Z 61 [Note] Aborted connection 61 to db: ‘unconnected’ user: ‘mha’ host: ‘197.xx.xx.xx(Got an error reading communication packets)
2016-03-17T14:44:31.273897Z 61 [Note] Aborted connection 61 to db: ‘unconnected’ user: ‘mha’ host: ‘197.xx.xx.xx(Got timeout reading communication packets)
上面两个是连接中断的错误信息,原因不一样,Got an error reading communication packets 的原因是因为网络等原因导致。 Got timeout reading communication packets 这个错误的原因是会话的idle时间达到了数据库指定的timeout时间。
第二种:SLAVE多线程同步的信息
如图,信息如下:
2016-03-14T15:48:26.432150Z 73 [Note]Multi-threaded slave statistics for channel ”: seconds elapsed = 121; eventsassigned = 100374529; worker queues filled over overrun level = 0; waited due aWorker queue full = 0; waited due the total size = 0; waited at clock conflicts= 1451875661700 waited (count) when Workers occupied = 3211993 waited whenWorkers occupied = 445032386000
2016-03-14T15:50:28.398745Z 73 [Note]Multi-threaded slave statistics for channel ”: seconds elapsed = 122; eventsassigned = 100500481; worker queues filled over overrun level = 0; waited due aWorker queue full = 0; waited due the total size = 0; waited at clock conflicts= 1452001865500 waited (count) when Workers occupied = 3211993 waited whenWorkers occupied = 445032386000
我们通过源代码,找到下面一段,该段实现了上述日志的输出。
if((my_now –rli->mts_last_online_stat)>=
mts_online_stat_period)
{
sql_print_information(“Multi-threadedslave statistics%s: “
“seconds elapsed = %lu; “
“events assigned = %llu; “
“worker queues filled over overrun level = %lu;”
“waited due a Worker queue full = %lu; “
“waited due the total size = %lu; “
“waited at clock conflicts = %llu “
“waited(count) when Workers occupied = %lu “
“waited when Workers occupied = %llu”,
rli->get_for_channel_str(),
static_cast
(my_now –rli->mts_last_online_stat),
rli->mts_events_assigned,
rli->mts_wq_overrun_cnt,
rli->mts_wq_overfill_cnt,
rli->wq_size_waits_cnt,
rli->mts_total_wait_overlap,
rli->mts_wq_no_underrun_cnt,
rli->mts_total_wait_worker_avail);
rli->mts_last_online_stat=my_now;
通过这一句(my_now –rli->mts_last_online_stat),以及最后一句rli->mts_last_online_stat=my_now;可以得知, seconds elapsed就是上一次统计跟这一次统计的时间间隔。
而mts_online_stat_period=120秒,硬代码,因此就是几乎每隔120秒,就有上述日志的输出。 通过进一步查看原代码,初步了解上述日志信息的含义,如下:
events assigned:总共有多少个event被分配执行,计的是总数。
worker queues filled over overrun level:多线程同步中,worker的私有队列长度超长的次数,计的是总数。
waited due a Worker queue full:因为worker的队列超长而产生等待的次数,计的是总数。
waited due the total size:超过最大size的次数,这个由参数slave_pending_jobs_size_max指定。
waited at clock conflicts:因为逻辑时间产生冲突的等待时间,单位是纳秒。
waited (count) when Workers occupied:因为workder被占用而出现等待的次数。(总计值)。
waited when Workersoccupied:因为workder被占用而出现等待的总时间,总计值,单位是纳秒。
第三种:page_cleaner线程的输出日志
如图,信息如下:
2016-03-24T17:45:28.005117Z 0 [Note] InnoDB:page_cleaner: 1000ms intended loop took 4750ms.The settings might not beoptimal. (flushed=1519 and evicted=0, during the time.)
查找源代码,发现是上面的日志由下面一段代码输出:
if(ret_sleep ==OS_SYNC_TIME_EXCEEDED) {
ulintcurr_time = ut_time_ms();
if(curr_time >next_loop_time + 3000) {
if(warn_count == 0) {
ib::info() <
” intended loop took “
<<1000 + curr_time
– next_loop_time
<
” be optimal. (flushed=”
<
<
<
<
if(warn_interval >300) {
warn_interval= 600;
}else{
warn_interval*= 2;
}
warn_count= warn_interval;
}else{
–warn_count;
}
}else{
/* reset counter */
warn_interval= 1;
warn_count= 0;
}
next_loop_time= curr_time + 1000;
n_flushed_last= n_evicted = 0;
}
通过分析源代码, 输出上述日志的条件是curr_time> next_loop_time + 3000,即比原定的循环时间next_loop_time多3000毫秒,而next_loop_time的标准时间是1000毫秒,即1秒钟做一次刷新页的操作。
loop took 4750ms,即是这次刷新循环的实际经历时间。
后面还有一个(flushed=1519 and evicted=0,during the time.)这样的日志,即对应n_flushed_last与n_evicted变量,而这两个变量又由n_flushed_list与n_flushed_lru赋值。
./storage/innobase/buf/buf0flu.cc:3322: n_flushed_last +=n_flushed_list;
./storage/innobase/buf/buf0flu.cc:3321: n_evicted += n_flushed_lru;
而n_flushed_list与n_flushed_lru赋值函数为pc_wait_finished,如下,我们来看看该函数的注释。
pc_wait_finished(&n_flushed_lru,&n_flushed_list);
/**
Wait until all flush requests are finished.
@param n_flushed_lru numberof pages flushed from the end of the LRU list.
@param n_flushed_list numberof pages flushed from the end of the
flush_list.
@return trueif all flush_list flushing batch were success. */
static
bool
pc_wait_finished(
ulint*n_flushed_lru,
ulint*n_flushed_list)
{
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
}
通过源代码的注释,我们获知如下信息:
n_flushed_lru number of pages flushed from the end of the LRU list.
n_flushed_lru这个值表示从lru列表尾部刷新的页数,也就是日志中如evicted=0指标的所表示的值,如果该值不为零,则存在innodb buffer不够的嫌疑。
n_flushed_list这个是从刷新列表中刷新的页数,也就是脏页数,也就是日志中flushed=1519的值。
mysql 错误等级_Mysql5.7 的错误日志中最常见的note级别日志解释相关推荐
- mysql note级别_Mysql5.7 的错误日志中最常见的note级别日志解释
在使用mysql5.7的时候,发现了不少在mysql5.6上不曾见过的日志,级别为note, 最常见的note日志以下三种,下面我们来逐个解释. 第一种,Aborted connection . 如上 ...
- 参数构造错误 微信_快速掌握前端开发中的常见错误
前言 今天我们来了解一下现在浏览器中支持的一些Error对象,如果你还在经常在捕获到错误的时候不知道该用哪个类型,总是习惯于去throw new Error('xx')的话,相信本文会帮你对error ...
- MySQL学习【第十二篇事务中的锁与隔离级别】
一.事务中的锁 1.啥是锁? 顾名思义,锁就是锁定的意思 2.锁的作用是什么? 在事务ACID的过程中,'锁'和'隔离级别'一起来实现'I'隔离性的作用 3.锁的种类 共享锁:保证在多事务工作期间,数 ...
- mysql日志文件的类型和作用_Mysql日志文件和日志类型介绍_MySQL
日志文件类型 MySQL有几个不同的日志文件,可以帮助你找出mysqld内部发生的事情: 日志文件 记入文件中的信息类型 错误日志 记录启动.运行或停止mysqld时出现的问题. 查询日志 记录建立的 ...
- mysql慢查询日志分析工具比较_MySQL慢查询日志总结 日志分析工具mysqldumpslow
慢查询日志概念 MySQL的慢查询日志是MySQL提供的一种日志记录,它用来记录在MySQL中响应时间超过阀值的语句,具体指运行时间超过long_query_time值的SQL,则会被记录到慢查询日志 ...
- mysql 日志抓取变化_MySQL慢查询日志分析提取【转】
原文:https://www.cnblogs.com/skymyyang/p/7239010.html 一:查询slow log的状态,如示例代码所示,则slow log已经开启. mysql> ...
- mysql慢查询日志默认在哪里_MySQL 慢查询日志
慢查询日志概念 MySQL 的慢查询日志是 MySQL 提供的一种日志记录,它用来记录在 MySQL 中查询响应时间超过阈值的语句,具体指响应时间超过 long_query_time 值的 SQL,会 ...
- windows log日志分割_如何将日志记录到 Windows事件日志 中
每当出现一些未捕获异常时,操作系统都会将异常信息写入到 Windows 事件日志 中,可以通过 Windows 事件查看器 查看,如下图: 这篇文章将会讨论如何使用编程的方式将日志记录到 Window ...
- ES Filebeat 使用 Pipeline 处理日志中的 @timestamp
推荐阅读 Helm3(K8S 资源对象管理工具)视频教程:https://edu.csdn.net/course/detail/32506 Helm3(K8S 资源对象管理工具)博客专栏:https: ...
最新文章
- ubuntu apache2 的负载均衡和反向代理
- VC++套接字、数据库、文件读写综合应用-客户端读取文件套接字接收服务端写入数据库
- MySQL--安装及配置
- 设计模式--代理(Proxy)模式
- java 文件指定位置插入_java 中利用io流将一个文件插入到另一个文件中的指定位置,指定位置...
- 华为手机怎么隐藏按键图标_华为手机隐藏技巧,一键简单设置,让沟通更加便捷...
- 如何使用 WinUSB 与 USB 设备 (USBDevice) 通信
- APP引导页UI设计素材模板|轻松留下完美的第一印象
- 3500x架构_如何评价超威半导体(AMD)新发布的 锐龙(Ryzen)3500X?
- 以太坊本地开发环境搭建
- android的GCM研究
- Maya批量属性修改链接插件1.1.0更新
- oracle连接ORA-01017、ORA-12640
- 计算机主机配件及图解,电脑主机结构图一览 功能配件解析
- python爬虫-国家企业_国家企业信用公示系统的爬取
- Chartboost ANE 使用教程(Chartboost ANE Tutorial)
- 一个描述二氧化硅的两体势能BKS
- 兔子繁殖问题(斐波那契数)
- 【手游项目4】过滤特殊字符,游戏账号名,玩家游戏名,数据库特殊字符检测
- KodBox_v1.15_学习笔记