fallocate (sync_file_range) vs fsync

{question}

What should my file system support?

{question}

{answer}  

NuoDB normally uses fallocate (and sync_file_range) to commit journal entries to disk. However, fallocate isn't supported on all filesystems, in which case we fall back to fsync and log the message like:

Notice: Could not preallocate file. Using fsync instead. fallocate: Operation not supported, File: ...

Notice: Could not preallocate file. Using fsync instead. fallocate: Operation not supported, File: /opt/<journal_path>/njf_0/1.njf

For Linux, it is highly recommended that your file system support fallocate(). The fallocate() system call is supported by the following:

  • XFS (since Linux kernel 2.6.38)
  • ext4 (since Linux kernel 3.0)
  • ZFS ((since ZFS on Linux kernel 0.6.4)
  • Btrfs (since Linux kernel 3.7)
  • tmpfs (since Linux kernel 3.5)

More information here.

Also, Tuning Tips for Journal Performance can be found here

{answer}

Have more questions? Submit a request

Comments