MySQL Forums
Forum List  »  InnoDB

Re: Setting innodb_flush_method to O_DIRECT on Centos 7.8
Posted by: Federico Razzoli
Date: November 21, 2020 08:42PM

Yes, IO_DIRECT prevents double buffering. InnoDB has its own buffer pool, and when you modify data/index pages that are cached, the change is made in memory until the modified pages are flushed to disk. But Linux buffer cache at this point could cache the page instead of writing it immediately. This makes very little sense, and you can avoid this with IO_DIRECT.

However with tmpfs there is no concept of "flushing data to disk", because everything stays in memory. The IO_DIRECT flag is disabled for tmpfs, simply because it doesn't matter.

Keep IO_DIRECT. It will avoid double buffering on your datadir, and it's irrelevant for your tmpdir.

--
Federico Razzoli
Director @ Vettabase Ltd
https://vettabase.com

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Setting innodb_flush_method to O_DIRECT on Centos 7.8
467
November 21, 2020 08:42PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.