-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Performance, Storage
-
None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
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.