Linux标准IO缓冲
/2012/09/17/linux标准io缓冲.html
2 Line buffered means that I/O takes place when a newline is encountered, when the process calls fflush, or when the process terminates by calling exit. 3 Unbuffered means that I/O take place each time a standard I/O output function is called. Most unix implementations of the standard I/O libarary use the following rules. 2 Standard input and standard output are fully buffered, unless they refer to a terminal device, in which case, they are line buffered. In which case, they are line buffered. Printf(...
MySQL如何避免使用Linux的swap分区而提升读写性能
/2012/09/19/mysql如何避免使用linux的swap分区而提升读写性能.html
再看看MyISAM的调用顺序是 mlockall() - lock memory() - mi repair(),MyISAM只有修复的时候会调用mlockall()函数。 在InnoDB里面可以找到os mem alloc large()调用了shmget(),而调用os mem alloc large()的函数只有buf pool init() InnoDB Buffer Pool的初始化函数。 通过搜索shmget(),我们可以找到MyISAM的调用顺序是这样的 shmget() - my large malloc int() - my large malloc() - init key cache()。 在InnoDB的源码目录里面匹配O DIRECT,很容易找到一个叫做os file set nocache()的函数,而这个函数作用是将文件的打开方式改为O DIRECT模式。 再跟踪一下,会发现只有os file create()函数调用了os file set nocache()。 We disable OS caching (O DIRECT) only on data files */.