binlog 相关参数
来源:互联网 发布:生死狙击矩阵 编辑:程序博客网 时间:2024/05/16 07:21
<pre name="code" class="sql">mysql> show variables like '%cache_size%';+----------------------------+----------------------+| Variable_name | Value |+----------------------------+----------------------+| binlog_cache_size | 131072 || binlog_stmt_cache_size | 32768 || host_cache_size | 654 || innodb_ft_cache_size | 8000000 || innodb_ft_total_cache_size | 640000000 || max_binlog_cache_size | 18446744073709547520 || max_binlog_stmt_cache_size | 18446744073709547520 || metadata_locks_cache_size | 1024 || query_cache_size | 1048576 || thread_cache_size | 18 |+----------------------------+----------------------+max_binlog_cache_size :(默认4GB, 也是最大值) 用于限制用于 cache 多个语句事务的总量。如果一个事务大于这个值,它会失败回滚。Max_binlog_cache_size: 默认值是18446744073709547520,这个值很大,够我们使用的了。此参数和binlog_cache_size相对应,代表binlog所能使用的cache最大使用大小。如果系统中事务过多,而此参数值设置有小,则会报错。The Binlog_cache_use status variable shows the number of transactions that used this buffer (and possibly a temporary file) for storing statements. The Binlog_cache_disk_use status variable shows how many of those transactions actually had to use a temporary file. These two variables can be used for tuning binlog_cache_size to a large enough value that avoids the use of temporary files.max_binlog_size = 512Mbinlog_cache_size = 128KBinlog_cache_use 显示 事务的数量被用于这个buffer(也可能是临时文件)用于存储语句。Binlog_cache_disk_use 显示多少的事务数 必须得使用临时文件这两个变量能用于调整binlog_cache_size 到一个足够大的值来避免使用临时文件max_binlog_size = 512MThe server also creates a new binary log file automatically after the current log's size reaches max_binlog_size. A binary log file may become larger than max_binlog_size if you are using large transactions because a transaction is written to the file in one piece, never split between files.server 也会自动的创建一个新的binary log 文件,在当前的log 大小达到max_binlog_size 的时候, 一个binary log 文件可能会大于max_binlog_size 如果你要使用大的事务 因为一个事务 会被写入到一个文件中,不会分隔到几个文件。参数:binlog_cache_size 就是满足以上两点的:一个事务,在没有提交(uncommitted)的时候,产生的日志,记录到Cache中;等到事务提交(committed)需要提交的时候,则把日志持久化到磁盘当一个thread 开始处理事务,它分配一个binlog_cache_size 的buffer 来buffer 语句。如果语句的大小大于这个值, thread 打开一个临时的文件来存储transaction,临时文件被删除在thread 结束后。mysql> show status like 'binlog_%';+----------------------------+---------+| Variable_name | Value |+----------------------------+---------+| Binlog_cache_disk_use | 445 || Binlog_cache_use | 9019263 |可以看到用到了临时文件,需要加大binlog_cache_size
0 0
- binlog 相关参数
- mysql之 binlog维护详细解析(开启、binlog相关参数作用、mysqlbinlog解读、binlog删除)
- mysql binlog 相关命令
- MySQL binlog相关分析
- MySQL binlog相关分析
- mysql binlog相关
- MySQL binlog日志参数简介
- MySQL Binlog 相关知识(二) -----BinLog 是什么样子
- MySQL Binlog 相关知识(一)
- binlog日志相关及恢复数据
- binlog日志相关的一些语句
- binlog
- mysql关闭binlog的两个参数
- MySQL中的binlog相关命令和恢复技巧
- MySQL中的binlog相关命令和恢复技巧
- MySQL中的binlog相关命令和恢复技巧
- 27 关于mysql 的binlog相关的几个问题
- MySQL参数binlog-do-db对binlogs写入的影响
- 2021 发工资咯:)
- POJ 3177 Redundant Paths(边双连通分量)
- Axis2创建WebService实例
- Cocos2d-X lua 学习笔记之消息弹窗
- Java包行业命名规则习惯
- binlog 相关参数
- 面试题35_第一个只出现一次的字符
- 双向队列 SDUT 1466
- 【暑期基础】A HDU 2000 ASCII码排序
- common
- Java--正则表达式
- 多线程五(同步静态函数)
- 多线程应用(三)
- 《图论》——深度优先搜索算法(DFS)