My application always needs to sync file data after writing. I don't want anything handing around in the kernel buffers. I am wondering what is the best method to accomplish this. 1. Do I use EXT2 and use fdatasync() or fsync()? 2. Do I use EXT2 and mount with the "sync" option? 3. Do I use EXT2 and use the O_DIRECT flag on open()? 4. Do I use EXT3 in full journaled mode, where the data and metadata are journaled? In this case, is the journaled data sync'd or async'd? When the journal commits the data to the file system, is that sync'd or dumped into kernel buffers? 5. Since I will always be syncing the data, does it make any sense to use EXT3? It feels like the EXT3 journal would be unnecessary. Thanks in advance --------------------------------- The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/ext3-users/attachments/20070321/282a25ef/attachment.htm>
On Mar 21, 2007 16:51 -0700, brian stone wrote:> My application always needs to sync file data after writing. I don't want anything handing around in the kernel buffers. I am wondering what is the best method to accomplish this.> 4. Do I use EXT3 in full journaled mode, where the data and metadata are journaled? In this case, is the journaled data sync'd or async'd? When the journal commits the data to the file system, is that sync'd or dumped into kernel buffers? > > 5. Since I will always be syncing the data, does it make any sense to use EXT3? It feels like the EXT3 journal would be unnecessary.In theory, ext3 + data=journal will give you the best performance, because sync IO will always be linear IO to the journal. Unless your filesystem is constantly busy, then the writes to the filesystem can happen asynchronously after being committed to the journal without danger of being lost. That said, nothing better than benchmarking your app with different filesystem options to see which one is best. Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc.
Reasonably Related Threads
- [PATCH] BUG on fsync/fdatasync with Ext3 data=journal
- writing processes are blocking in log_wait_common with data=ordered
- [PATCH] OCFS2: fdatasync should skip unimportant metadata writeout
- ext3 data=ordered - good enough for oracle?
- 64 K write access grouped in a single disk access ?