官方文档并没有直接告诉如何调整 innodb_log_buffer_size 大小,

根据对mysql 的状态信息了解知道  innodb_log_buffer_size 跟 Innodb_os_log_written 和 Com_commit 状态有关系。

  1. Innodb_os_log_written: innodb 引擎redo log  多少个字节被写入
  2. Com_commit : 在autocommit = 0 时候 有多少个innodb 事务提交 ,如果autocommit = 1,innodb 事务不包括在Com_commit 中
  3. 以上参考: https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx
  4. 在业务压力测试或者高峰时间段进行以下操作:
set global autocommit = 0;

SHOW GLOBAL STATUS LIKE 'Innodb_os_log_written';

 经过一段长时间.............

SHOW GLOBAL STATUS LIKE 'Com_commit';

通过以下公式计算平均每个事务要缓冲的平均数据量多少个bytes,前提你需要保留多长时间的redo log buffer
Innodb_os_log_written / Com_commit 

在业务高峰运行期间如果 Innodb_log_waits 值为0或接近0, innodb_log_buffer_size 可能太大,可以减少。

set @old_value := 0;
set @new_value := 0;
select VARIABLE_VALUE into @old_value from information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Innodb_log_waits';
select SLEEP(时间);
select VARIABLE_VALUE into @new_value from information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Innodb_log_waits';
select @old_value;
select @new_value;

最新文章

  1. [DS Basics] Data structures
  2. 从web页面启动winform程序的实现方法
  3. Skip list--reference wiki
  4. HttpClient Post Get请求方法,留在以后可能会用到
  5. Visual C++ 打印编程技术-打印基础知识
  6. 配置toad进行导入导出数据库操作
  7. MYSQL常用命令集合(转载)
  8. 舵机的PWM控制学习随笔
  9. thinkphp微信开发:安全模式消息加解密
  10. 使用SQL脚本删除冗余的视图和表
  11. uml笔记
  12. JDK1.8源码阅读系列之一:ArrayList
  13. 记录maven的一些命令
  14. 关于eclipse安装springide的记录
  15. Codeforces 1090A - Company Merging - [签到水题][2018-2019 Russia Open High School Programming Contest Problem A]
  16. FluentData -Micro ORM with a fluent API that makes it simple to query a database 【MYSQL】
  17. Spark学习之路 (九)SparkCore的调优之数据倾斜调优
  18. Round Numbers(数位DP)
  19. VS自带的dbghelp.h文件 报错
  20. java的poi技术读取Excel数据

热门文章

  1. 2018.07.23 洛谷P4097 [HEOI2013]Segment(李超线段树)
  2. arduino IO口
  3. Linux设置开机启动项
  4. AngularJS标准Web业务流程开发框架—1.AngularJS模块以及启动分析
  5. No cache or cacheManager properties have been set. Authorization cache cannot be obtained.
  6. web service 项目 和 普通 web项目 的 区别
  7. MFC框架仿真<二>
  8. Ubuntu 14.04 LTC 有线网络--网线不识别,灯不亮问题
  9. Codeforces805 C. Find Amir 2017-05-05 08:41 140人阅读 评论(0) 收藏
  10. 菜鸟——使用bootstrap