简体   繁体   中英

Setting innodb_flush_method to O_DIRECT on Centos 7.8

I have read that you should set innodb_flush_method to O_DIRECT in MySQL to avoid double buffering. I have also read that you should not use tmpfs for the tmpdir, because that will disable AIO.

While researching these claims, I found that Centos comes with tmpfs on the tmpdir automatically. I have read that this can create conflicts with O_DIRECT.

One suggested solution is to change the temporary folder for MySQL so that you can use native AIO and avoid double buffering.

Are the claims about double buffering correct?

Or should you just not set innodb_flush_method and let the tmpdir be the default with tmpfs?

Set innodb_flush_method to O_DIRECT (otherwise you will be churning the page cache by double caching). I don't think having tmpdir=/tmp on tmpfs disables aio entirely for MySQL, but if it does, you are better off making /tmp on a regular file system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM