Innodb怎么自动开启打印显示引擎状态到犯错日志

  介绍

本篇内容介绍了“Innodb怎么自动开启打印显示引擎状态到犯错日志”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

一、问题描述

为什么我的犯错日志里面有大量的显示引擎Innodb状态的记录,我自己并没有开启innodb_status_output参数。

二,问题分析

通过查看日志,发现如下输出:

 2019 - 03 - 21 - t17:00:02.375231z  1230497,[警告],Innodb:, Difficult 用find  free  blocks 拷贝,buffer  pool (338年,search 迭代)!,0,failed  attempts 用flush  a 页!,Consider  increasing 从而buffer  pool 大小只It  is  also  possible 
  that  your 拷贝;Unix  version  fsync  is 非常缓慢,趁机completely  frozen  inside 从而OS 内核只Then  upgrading 用a 
  newer  version  of  your  operating  system  may 帮助只Look  at 从而number  of  fsyncs 拷贝diagnostic  info 低于又是;
  Pending  flushes  fsync(),日志:,0;,buffer 池:,0只1446962050,OS  file 读,,545881917,OS  file 写道,,
  376257282,OS  fsync只Starting  InnoDB  Monitor 用print  further  diagnostics 用,standard 输出。

日志也写得很清楚。应该是自由块不够了Innodb自动开启了。但是我们需要源码验证一下。

三源码验证

在源码的buf_LRU_handle_lack_of_free_blocks函数中我们看到如下:

 if  ((current_ms 祝辞,started_ms  +, 2000)
  ,,,,,,,,,,(current_ms 祝辞,last_printout_ms  +, 2000)
  ,,,,,,,,,,srv_buf_pool_old_size ==, srv_buf_pool_size), {
  ,,,,,,,ib:警告(),& lt; & lt;,“Difficult 用find  free  blocks 拷贝,buffer  pool"
  ,,,,,,,,,,,,,(“,& lt; & lt;, n_iterations  & lt; & lt;,“, search 迭代)!,“
  ,,,,,,,,,,,,,,& lt; & lt;, flush_failures  & lt; & lt;,“, failed  attempts  to"
  ,,,,,,,,,,,,,flush  a 页!,Consider  increasing 从而buffer  pool"
  ,,,,,,,,,,,,,大小只It  is  also  possible  that 拷贝your  Unix  version"
  ,,,,,,,,,,,,,fsync  is 非常缓慢,趁机completely  frozen  inside"
  ,,,,,,,,,,,,,,OS 内核只Then  upgrading 用a  newer  version"
  ,,,,,,,,,,,,,of  your  operating  system  may 帮助只Look  at  the"
  ,,,,,,,,,,,,,number  of  fsyncs 拷贝diagnostic  info 下面!”
  ,,,,,,,,,,,,,Pending  flushes  (fsync),日志:,“
  ,,,,,,,,,,,,,,& lt; & lt; fil_n_pending_log_flushes
  ,,,,,,,,,,,,,,& lt; & lt;,“, buffer 池:,“
  ,,,,,,,,,,,,,,& lt; & lt; fil_n_pending_tablespace_flushes
  ,,,,,,,,,,,,,,& lt; & lt;,“只“,& lt; & lt;, os_n_file_reads  & lt; & lt;,“, OS  file 读,,,
  ,,,,,,,,,,,,,,& lt; & lt;, os_n_file_writes  & lt; & lt;,“, OS  file 写道,“
  ,,,,,,,,,,,,,,& lt; & lt; os_n_fsyncs
  ,,,,,,,,,,,,,,& lt; & lt;,“, OS  fsync只Starting  InnoDB  Monitor 用保险单上;
  ,,,,,,,,,,,,,further  diagnostics 用,standard 输出!”;
  ,,,,,,,last_printout_ms =, current_ms;
  null
  null
  null
  null
  null

Innodb怎么自动开启打印显示引擎状态到犯错日志