最近在看mysql performance这本书,其中有一段话讲到 innodb_max_dirty_pages_pct,有点不太明白,希望大家指教:
原文:
You can tweak the threshold for your workload if you wish to spread out the writes a
bit more. For example, lowering it to 50 will generally cause InnoDB to do more write
operations, because it will flush pages sooner and therefore be unable to batch the
writes as well. However, if your workload has a lot of write spikes, using a lower
value may help InnoDB absorb the spikes better: it will have more “spare” memory to
hold dirty pages, so it won’t have to wait for other dirty pages to be flushed to disk.为什么降低nnodb_max_dirty_pages_pct会增加写操作

解决方案 »

  1.   

    如果你看到句估计就明白了。这个百分比是,最大脏页的百分数,当系统中 脏页 所占百分比超过这个值,INNODB就会进行写操作以把页中的已更新数据写入到磁盘文件中。
      

  2.   

    明白了,因为脏页小的话,无法将几个改变一起flush到磁盘上去了。脏页越大,可以拼凑在一起flush到磁盘上去,狼头不知道我理解的对不?