在TimesTen的属性定义中,有一项属性是LogFlushMethod,有三个值0,1,2。
 
LogFlushMethod
0— Write data to the log files using the previously used value.
1— Write data to log files using buffered writes and use explicit sync operations as needed to sync log data to disk (for example with durable commits). This is the default.
2—Write data to log files using synchronous writes such that explicit sync operations are not needed.
 
 
其缺省值是1,可选有2 和 0(同以前的设置)。那么1和2之间到底有什么不同呢?
 
LogFlushMethod=1意味着以常规的模式打开LogFile,写的时候也就是普通的write(),当需要同步的时候,比如调用durablecommit,此时才在write()之后紧接着调用fdatasync()。
 
LogFlushMethod=2意味着以O_SYNC的方式打开LogFile,所有的写操作都是同步的,且都包含在write()里面了。
 
两种模式的选择取决与操作系统、存储硬件以及系统的压力等各方面的因素。一般来说,当存储不是很好,且只有少量durable commits的时候,LogFlushMethod=1性能更好。
 
当存储很好(尤其是同步写性能),比如RAID;且包含大量的durable commits的时候,LogFlushMethod=2性能更好。
 
上面只是一个初步的参考,具体的环境做对比验证才是正确决定的基础。
 
参考连接:
 
 
 

留言