6

Ext3 and Ext4 have a default journal commit interval of 5 seconds, which can be changed with the 'commit' mount option.

I can verify that my VirtualBox host indeed flashes its disk icon after 5 seconds (or whatever value I set for the commit mount option) whenever I do any file operation inside my Linux VM with Ext3/4, like 'echo test > my_new_file' (depending on the mount options, this might write file metadata only, or file data followed by its metadata but this is a separate question)

What is the default journal commit interval of XFS? Can it be configured?

I couldn't find any documented XFS mount option for this. With XFS, I do see that the disk icon might not flash for more than 10 seconds after I create a new file. As expected if I crash the kernel before I see disk activity, after the reboot my_new_file will not exist. Also, as expected, if I crash the kernel after I see the disk activity, this will usually be the XFS journal commit activity so if I crash the kernel at this point, after reboot my_new_file will exist, but will be empty.

Ivan
  • 169
  • 1
  • 7
  • 1
    TL;DR http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/xfs-delayed-logging-design.txt – HBruijn Nov 21 '14 at 15:55

1 Answers1

5

From the kernel documentation not a mount option but apparently the following sysctl setting:

fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000)
The interval at which the filesystem flushes metadata out to disk and runs internal cache cleanup routines.

So the default is 3000/100 = 30 seconds.

HBruijn
  • 72,524
  • 21
  • 127
  • 192