[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: |
|
||||||||
| Issue Links: |
|
||||||||
| 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 |
| 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 |
| 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 |
| 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. |