国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

mysql innodb 重做日志 寫滿了怎么辦?
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-04-17 11:31:08
0
1
326

innodb數(shù)據(jù)目錄下默認會有2個名為ib_logfile0和ib_logfile1的重做日志文件,mysql寫重做日志的過程是,事務(wù)進行的過程中,master thread主線程不斷的將事務(wù)中的條目,插入到重做日志緩沖,然后同步到磁盤的重做日志文件(ib_logfile),先寫日志文件1(ib_logfile0),寫滿了,再切換至日志文件2(ib_logfile1),當日志文件2被寫滿了,再切換到日志文件1(ib_logfile0);

問題:既然磁盤上的日志文件1和2已經(jīng)寫滿了,為什么還會再重新切換到日志1再寫入呢?滿了還怎么寫入?

PHP中文網(wǎng)
PHP中文網(wǎng)

認證高級PHP講師

reply all(1)
迷茫

The ib_logfile of innodb is a fixed-length file, which can be set through innodb_log_file_size = 64M in my.cnf. mysql will write data sequentially in the pre-allocated space. Until it can no longer be written, it will switch to the next file and continue writing, just like using a circular array in memory. Generally, this kind of log has no long-term value, so this strategy saves disk space and can avoid disk fragmentation, additional IO and other problems caused by the increase in file size.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template