两次写是innodb的一个重要特性,目的是为了保证在异常down机或者没电的情况下,保证数据的安全可靠。一次是往内存的double write buffer中写,一次是在刷共享表空间的连续128个页。

为什么需要double write buffer?

innodb page一个页是64KB,而通常情况下都是一个页的一部分被修改,比如8KB,而其他的保持原状。而对于大多数Linux系统默认的block size是4KB,所以一个innodb page会被分成好多块,分别被刷

在没写入真正的ibd文件之前,double write buffer都是顺序写;当往ibd文件刷的时候才是离散写;查看double write运行情况可以用以下命令:

是否打开了double write:

show variables like "%double%";

查看double write的使用情况:

SHOW global STATUS LIKE "%innodb_dblwr%";

相当于每次write合并了Innodb_dblwr_pages_written/Innodb_dblwr_writes次Flush

当Innodb_dblwr_pages_written/Innodb_dblwr_writes 比例越大时说明DB的压力很小

关闭double buffer,在my.cnf中添加(生产中不建议这么做)

innodb_doublewrite=0

innodb double write buffer的更多相关文章

  1. insert buffer/change buffer double write buffer,双写 adaptive hash index(AHI) innodb的crash recovery innodb重要参数 innodb监控

    https://yq.aliyun.com/articles/41000 http://blog.itpub.net/22664653/viewspace-1163838/ http://www.cn ...

  2. InnoDB Double write

    记得刚开始看InnoDB文档的时候,Double Write一节(其实只有一小段)就让我很困惑.无奈当时内力太浅,纠缠了很久也没弄明白.时隔几个月,重新来整理一下. 涉及到的概念:Buffer Poo ...

  3. Innodb之监控Buffer pool Load progress

    你可以使用PERFORMANCE SCHEMA中的相关信息监控BUFFER POOL状态加载进程. 1. 启用 stage/innodb/buffer pool load instrument: 2. ...

  4. InnoDB Status Output – Buffer Pool and Spin Rounds

    InnoDB has a good source of information about its status which can be requested every time you need ...

  5. [Reactive Programming] Using an event stream of double clicks -- buffer()

    See a practical example of reactive programming in JavaScript and the DOM. Learn how to detect doubl ...

  6. MySQL InnoDB缓冲池(Buffer Pool)

    InnoDB缓冲池并不仅仅缓存索引,它还会缓存行的数据.自适应哈希索引.插入缓冲(Insert Buffer).锁,以及其他内部数据结构. InnoDB还使用缓冲池来帮助延迟写入,这样就能合并多个写入 ...

  7. Double write Buffer的配置

    InnoDB和XtraDB使用称为doublewrite缓冲区的特殊功能来提供数据损坏的强大保证.想法是在写入数据文件之前将数据写入主表空间中的顺序日志.如果发生部分页面写入(换句话说,写入损坏),I ...

  8. innodb之change buffer被动merge

    被动merge情景一.二级索引页空间不足:ibuf0ibuf.cc:: ibuf_insert_low 1.当尝试缓存插入操作时,假设预估二级索引page的空间不足.可能导致索引分裂,则定位到尝试缓存 ...

  9. Mysql InnoDB三大特性-- double write

    转自:http://www.ywnds.com/?p=8334 一.经典Partial page write问题? 介绍double write之前我们有必要了解partial page write( ...

随机推荐

  1. iOS: 讯飞语音的使用

    一.介绍: 讯飞语音做的相当不错,容错率达到90%多,如果需要做语音方面的功能,它绝对是一个不错的选择.讯飞语音的功能很多:语音听写.语音识别.语音合成等,但我们最常用的还是语音听写.讯飞语音中包含界 ...

  2. Android 使用FACE++架构包实现人脸识别

    今天给大家带来一个通过使用Face++来实现人脸识别的功能. 我们先去这个Face++官网看看:http://www.faceplusplus.com.cn 我们点开案例可以看到众多我们熟知的软件都是 ...

  3. connect调用超时的实现方式

    第二种更通用的.使connect调用超时的方法是使套接字成为无阻塞的,然后用select等待它完成.这种方法避免了使用alarm时遇到的很多问题,但我们必须承认,即使是在UNIX实现中,这种方法还是存 ...

  4. MongoDB的C#封装类

    代码: samus驱动 using System; using System.Collections.Generic; using System.Linq; using System.Text; us ...

  5. RFS_窗口或区域之间的切换

    1.  测试用例描述 [前置条件]: 1. 已经登录系统 [测试步骤]: 1. 验证登录成功 2. 选择[用户管理]菜单 3. 打开[新增用户]页面 4. 输入必填字段,点击[Submit]按钮 [预 ...

  6. button点击传多个参数

    // --------------------button点击传多个参数------------------------ UIButton *btn = [UIButton buttonWithTyp ...

  7. Leetcode: Max Sum of Rectangle No Larger Than K

    Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix s ...

  8. session 实现保存用户信息

    index.jsp <body> <div style="margin: 0 auto; width: 500px; text-align: center;"&g ...

  9. 数dp多少个0-n多少0-9

    #include <bits/stdc++.h> using namespace std; const int N = 15; int n; int dp[N][N][N]; int a[ ...

  10. nyist 676 小明的求助

    http://acm.nyist.net/JudgeOnline/problem.php?pid=676 小明的求助 时间限制:2000 ms  |  内存限制:65535 KB 难度:2   描述 ...