innodb_flush_method理解
来源:互联网 发布:建行网络学系统 - 百度 编辑:程序博客网 时间:2024/05/17 01:57
innodb_flush_method这个参数控制着innodb数据文件及redo log的打开、刷写模式,对于这个参数,文档上是这样描述的:
有三个值:fdatasync(默认),O_DSYNC,O_DIRECT
默认是fdatasync,调用fsync()去刷数据文件与redo log的buffer
为O_DSYNC时,innodb会使用O_SYNC方式打开和刷写redo log,使用fsync()刷写数据文件
为O_DIRECT时,innodb使用O_DIRECT打开数据文件,使用fsync()刷写数据文件跟redo log
首先文件的写操作包括三步:open,write,flush
上面最常提到的fsync(int fd)函数,该函数作用是flush时将与fd文件描述符所指文件有关的buffer刷写到磁盘,并且flush完元数据信息(比如修改日期、创建日期等)才算flush成功。
使用O_SYNC方式打开redo文件表示当write日志时,数据都write到磁盘,并且元数据也需要更新,才返回成功
O_DIRECT则表示我们的write操作是从mysql innodb buffer里直接向磁盘上写
至此我再总结一下三者写数据方式:
fdatasync模式:写数据时,write这一步并不需要真正写到磁盘才算完成(可能写入到操作系统buffer中就会返回完成),真正完成是flush操作,buffer交给操作系统去flush,并且文件的元数据信息也都需要更新到磁盘。
O_DSYNC模式:写日志操作是在write这步完成,而数据文件的写入是在flush这步通过fsync完成
O_DIRECT模式:数据文件的写入操作是直接从mysql innodb buffer到磁盘的,并不用通过操作系统的缓冲,而真正的完成也是在flush这步,日志还是要经过OS缓冲
- innodb_flush_method理解
- innodb_flush_method理解
- innodb_flush_method理解
- innodb_flush_method理解(图解)
- MySQL innodb_flush_method理解
- innodb_flush_method
- innodb_flush_method
- MySQL Innodb_flush_method
- innodb_flush_method&innodb_flush_log_at_trx_commit
- 针对innodb_flush_method参数的理解和对比测试(mycat+mysql)
- innodb_flush_log_at_trx_commit和innodb_flush_method
- innodb_flush_method参数图解
- innodb_flush_method带来的性能影响
- innodb_flush_method 与 File I/O
- innodb_flush_method 与 File I/O
- innodb_flush_method 与 File I/O
- innodb_flush_method 与 Linux File I/O
- MySQL innodb_flush_method 与 File I/O (Linux)
- Spring+SpringMVC+MyBaties学习笔记(二)集成Spring SpringMVC MyBatis
- Web 研发模式演变 (转自玉伯)
- MFC添加图片后,编译报error RC2108:expected numerical dialog constant
- Volly 发送网络请求过程分析
- Displaying Graphics with OpenGL ES(四)——Applying Projection and Camera Views
- innodb_flush_method理解
- 这是一个开始
- 作为一个J2EE软件攻城师
- mysql安装和配置
- Android Stuidio解决更新下载时无法连接URL的问题
- 158 js timer函数
- webStorm 开启NodeJs Core library 使用
- 红黑树算法介绍
- 关于iOS开发中info.plist文件的解读