怎样优化调整innodb_log_buffer_size
2024-10-20 20:58:25
官方文档并没有直接告诉如何调整 innodb_log_buffer_size 大小,
根据对mysql 的状态信息了解知道 innodb_log_buffer_size 跟 Innodb_os_log_written 和 Com_commit 状态有关系。
- Innodb_os_log_written: innodb 引擎redo log 多少个字节被写入
- Com_commit : 在autocommit = 0 时候 有多少个innodb 事务提交 ,如果autocommit = 1,innodb 事务不包括在Com_commit 中
- 以上参考: https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx
- 在业务压力测试或者高峰时间段进行以下操作:
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;
最新文章
- [DS Basics] Data structures
- 从web页面启动winform程序的实现方法
- Skip list--reference wiki
- HttpClient Post Get请求方法,留在以后可能会用到
- Visual C++ 打印编程技术-打印基础知识
- 配置toad进行导入导出数据库操作
- MYSQL常用命令集合(转载)
- 舵机的PWM控制学习随笔
- thinkphp微信开发:安全模式消息加解密
- 使用SQL脚本删除冗余的视图和表
- uml笔记
- JDK1.8源码阅读系列之一:ArrayList
- 记录maven的一些命令
- 关于eclipse安装springide的记录
- Codeforces 1090A - Company Merging - [签到水题][2018-2019 Russia Open High School Programming Contest Problem A]
- FluentData -Micro ORM with a fluent API that makes it simple to query a database 【MYSQL】
- Spark学习之路 (九)SparkCore的调优之数据倾斜调优
- Round Numbers(数位DP)
- VS自带的dbghelp.h文件 报错
- java的poi技术读取Excel数据
热门文章
- 2018.07.23 洛谷P4097 [HEOI2013]Segment(李超线段树)
- arduino IO口
- Linux设置开机启动项
- AngularJS标准Web业务流程开发框架—1.AngularJS模块以及启动分析
- No cache or cacheManager properties have been set. Authorization cache cannot be obtained.
- web service 项目 和 普通 web项目 的 区别
- MFC框架仿真<;二>;
- Ubuntu 14.04 LTC 有线网络--网线不识别,灯不亮问题
- Codeforces805 C. Find Amir 2017-05-05 08:41 140人阅读 评论(0) 收藏
- 菜鸟——使用bootstrap