Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4652

Don't use fallocate on NFS

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: None
    • Component/s: Performance, Storage
    • Labels:
      None

      The fallback behavior of fallocate is extremely suboptimal on NFS as it does one synchronous write for every 64kB to allocate. The attached patch takes the approach recommended by NetAPP which is to use ftuncate to create a sparse file of the correct size when we detect NFS mounts. Testing shows that this improves insert performance 5-10%.

      Currently is uses linux-specific FS detection code and does this automatically without user intervention. It may be better to add a flag since there are other filesystems (in particular copy-on-write systems such as ZFS or BTRFS) where it is better to create a sparse file than fully allocating a file full of zeros.

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: