[SERVER-4652] Don't use fallocate on NFS Created: 09/Jan/12  Updated: 11/Jul/16  Resolved: 06/Feb/12

Status: Closed
Project: Core Server
Component/s: Performance, Storage
Affects Version/s: None
Fix Version/s: 2.1.1

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File ftruncate.patch    
Issue Links:
Depends
Related
Participants:

 Description   

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.



 Comments   
Comment by auto [ 06/Feb/12 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Temp disable test for BtrFS SERVER-4652
Branch: master
https://github.com/mongodb/mongo/commit/3078b6e9b25eab8883d546081bffe614c4d1c4c3

Comment by auto [ 06/Feb/12 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Fix signed / unsigned comparison SERVER-4652
Branch: master
https://github.com/mongodb/mongo/commit/78520fda45035bbdb1af6bc84ead2cde99f6c6eb

Comment by auto [ 06/Feb/12 ]

Author:

{u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: Use sparse files on freebsd, solaris, and when using NFS or BtrFS on linux SERVER-4652
Branch: master
https://github.com/mongodb/mongo/commit/b722567affe6ae082af56e56349d2c67bff26ade

Comment by Mathias Stearn [ 31/Jan/12 ]

OK, this is now implemented on my local checkout (with a different patch) but will not hit master until after 2.1.0.

Generated at Thu Feb 08 03:06:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.