在V5.5中,MYSQL对这一块进行了强化,增加三个参数:

sync_relay_log_info # default 0

sync_master_info # default 0

sync_relay_log # default 0

让他们来控制,每隔多少个SLAVE日志“语句/事务”,触发同步一次相关文件;

-----------------------------------------------------------

# sync_relay_log_info

If the value of this variable is greater than 0,

a replication slave synchronizes its relay-log.info file to disk (using fdatasync()) after every sync_relay_log_info transactions.

A value of 1 is the generally the best choice.

The default value of sync_relay_log_info is 0,

which does not force any synchronization to disk by the MySQL server—in this case,

the server relies on the operating system to flush the relay-log.info file's contents from time to time as for any other file.

# sync_master_info

If the value of this variable is greater than 0,

a replication slave synchronizes its master.info file to disk (using fdatasync()) after every sync_master_info events.

The default value of sync_relay_log_info is 0 (recommended in most situations),

which does not force any synchronization to disk by the MySQL server;

in this case, the server relies on the operating system to flush the master.info file's contents from time to time as for any other file.

# sync_relay_log

If the value of this variable is greater than 0,

the MySQL server synchronizes its relay log to disk (using fdatasync()) after every sync_relay_log writes to the relay log.

There is one write to the relay log per statement if autocommit is enabled, and one write per transaction otherwise.

The default value of sync_relay_log is 0, which does no synchronizing to disk—in this case,

the server relies on the operating system to flush the relay log's contents from time to time as for any other file.

A value of 1 is the safest choice because in the event of a crash you lose at most one statement or transaction from the relay log.

However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes synchronization very fast).

他们的工作模式和效果有点像:sync_binlog 参数,在设置的时候我们要注意IO性能评估,特别是对relay-log的sync;

一般的SLAVE,即打开BINLOG写,现在又要频繁刷新relay-log写,对IO的压力有所增加;

比如:relay-log.info 的刷新:

假如我们最安全地设置sync_relay_log_info=1 , 那么每执行完一个SQL/事务,SLAVE进程更新relay-log.info后,就需要刷到DISK;

假设我们机器能执行QPS=1000,这也就要求relay-log.info刷新1000次;(当然DISK如果有RAID CACHE,并且write-back生效;情况会好很多)

算起来还是很吓人的;

但考虑到SLAVE一般不承载SELECT带来的压力 ;所以压力一般不会超过MASTER;

只要MASTER与SLAVE硬件配置相当;应该是不用担心这个问题;

另外,v5.5中还有一个参数:relay_log_recovery ,

当被设置成ENABLED,在CRASH后自动放弃所有未执行的relay-log,并且重新从MASTER获取日志;这样保证relay-log的完整;

Enables automatic relay log recovery immediately following server startup,

which means that the replication slave discards all unprocessed relay logs

and retrieves them from the replication master.

This should be used following a crash on the replication slave to ensure that no possibly corrupted relay logs are processed.

The default value is 0 (disabled).

This global variable can be changed dynamically, or by starting the slave with the --relay-log-recovery option.

mysql 同步日志文件_mysql 5.5 中对SLAVE relay-log相关日志文件同步的强化相关推荐

  1. 在CANoeCANalyzer中“在线回放”CAN Log.asc/blf文件

    案例背景(共11页精讲): 该篇博文将告诉您,在CANoe/CANalyzer中,"Online在线"模式下,回放一个CAN Log.asc/blf文件,重现那时CAN网络中CAM ...

  2. mysql 数据修改记录日志_mysql对数据的更新操作记录在哪个日志中?

    mysql对数据的更新操作记录在通用查询日志和二进制日志中.通用查询日志用来记录用户的所有操作,包括启动和关闭 MySQL 服务.更新语句和查询语句等:二进制日志会以二进制的形式记录数据库的各种操作, ...

  3. mysql xp cmdshell_LOAD语句:利用MSSQL中的xp_cmdshell功能,将指定文件夹下的指定文件,生成mysql的LOAD语句...

    LOAD语句:利用MSSQL中的xp_cmdshell功能,将指定文件夹下的指定文件,生成mysql的LOAD语句 LOAD语句:利用MSSQL中的xp_cmdshell功能,将指定文件夹下的指定文件 ...

  4. mysql cascade的用法_MySql和Hibernate中关于cascade的用法

    数据库里的cascade的用法,Mysql和Hibernate里面是不相同. 在数据库里,进行增加.修改.删除记录的时候,经常会涉及到父子关系的表. 例如:有省份表和城市表,其中城市表有一个外键pro ...

  5. mysql操作json优点和缺点_MYSQL 5.7中的本机JSON支持:MYSQL中JSON数据类型的优缺点是什么?...

    在MySQL 5.7中,新的数据类型用于在JSON表中存储JSON数据. 添加. 显然,这将是MySQL的巨大变化. 他们列出了一些好处 Document Validation - Only vali ...

  6. mysql查询语句 变量_mysql查询语句中用户变量的使用

    先上代码吧 SELECT `notice`.`id` , `notice`.`fid` , `notice`.`has_read` , `notice`.`notice_time` , `notice ...

  7. java slf4j日志级别_java - 在slf4j中设置运行时消息的日志级别 - 堆栈内存溢出

    ===============>>#1 票数:41 已采纳 使用slf4j无法做到这slf4j . 我想,缺少这个功能的原因是,几乎不可能为slf4j构建一个Level类型,它可以有效地映 ...

  8. php 拖拽 上传文件 进度,在Vue中如何实现带进度条的文件拖动上传功能

    这篇文章主要介绍了Vue实现带进度条的文件拖动上传功能,本文通过实例代码给大家介绍的非常详细,具有参考借鉴价值,需要的朋友可以参考下 1. 基本界面 content="width=devic ...

  9. cof文件在C语言中怎么引入,暗黑2MOD之COF文件简单介绍

    COF文件简单介绍 在游戏中,总是充满了人物与怪物,人物与人物之间的互动,而这种互动是建立在形形色色的动作的基础之上的.而掌管这个不断运动中的世界的上帝,就是COF文件,也就是人物和怪物的动作动画文件 ...

最新文章

  1. java之php、Android、JAVA、C# 3DES加密解密
  2. spring教程极客学院,Mybatis-Plus学习总结(超详细整理
  3. 160个Crackme031之一元二次方程
  4. 我是怎么利用微信做兼职月入1W的
  5. excel单元格斜线_掌握这20个Excel技巧,小白轻松变大神
  6. protractor端到端测试简介
  7. 004-linux常用命令-权限管理命令
  8. 水泵怎么做_燃气壁挂炉初次调试,要怎么做才好?
  9. linux pppoe 共享上网,Linux操作系统下如何PPPOE拨号共享上网?
  10. python26章_[Python设计模式] 第26章 千人千面,内在共享——享元模式
  11. AOP切面编程的理解
  12. 一种兼顾速度和效果的对比度增强算法——CONTRAST ENHANCEMENT BASED ON LAYERED DIFFERENCE REPRESENTATION
  13. 重新认识Git——抽丝剥茧说Git
  14. 用matlab产生正弦信号并采样,正弦信号的采样与恢复..doc
  15. 音视频延时和抖动问题分析和解决
  16. 单面机51小车程序_4千元牛排机实测!小白也能做出星级牛排,在家吃出法式餐厅感觉...
  17. HDU 4379 The More The Better
  18. 虚函数、虚函数表、虚继承
  19. 价值创造链路及经营计划
  20. eclipse注释字体大小显示不一样大

热门文章

  1. object转成实体对象_Object.assign 原理及其实现
  2. java 数据结构实例_数据结构(Java)——栈的实例
  3. 返回数组个数Java_用java实现返回一个整数数组中最大数组的和
  4. 居然以反战的名义,利用开源工具包“投毒”!
  5. YYDS 的 IDEA插件,没装上的安排起来!
  6. 皮一皮:我真的没买这么多...
  7. 仅用六个字符来完成Hello World,你能做到吗?
  8. MySQL 数据库的优化,你知道有哪些?
  9. JVM调优实战:G1中的to-space exhausted问题
  10. 未来计算机将怎么样改变我的生活,未来人类都不用上班 人工智能将如何改变我们的生活?...