| 取值 | 0=OS 决定;1=每次提交 fsync;N=每 N 个事务 fsync |
|---|---|
| 默认 | MySQL 8.0 默认 sync_binlog=1 |
| 配套 | 与 redo 的刷盘参数共同决定崩溃安全级别 |
查看与调整
查看与调整
SHOW VARIABLES LIKE 'sync_binlog';
SET GLOBAL sync_binlog = 1;
SHOW STATUS LIKE 'Binlog_cache%';
SHOW BINARY LOGS;主从复制场景下 binlog 刷盘还影响复制延迟:主库提交速度被磁盘 fsync 决定时,先看 IO 延迟再谈调参。