-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decrease Linux and FreeBSD max request payload size from 16MB to 128kB
OSX is kept at 16MB to avoid triggering a bug with large Setxattr calls: #42 While this was already using sync.Pool and in theory reusing the buffers, real world isn't as merciful. Apparently 2*16MB plus some waste from other parts of the system was enough to keep triggering GC runs all too often. Decreasing the buffer size helps keep us below that threshold. New buffer size is the largest Write payload size observed on Linux, and the most common size for write-heavy workloads. Improves performance and decreases memory use on Linux. Thanks to Aaron Jacobs <[email protected]> and Damien Tournoud <[email protected]>.
- Loading branch information
Showing
4 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fuse | ||
|
||
// Maximum file write size we are prepared to receive from the kernel. | ||
// | ||
// This value has to be >=16MB or OSXFUSE (3.4.0 observed) will | ||
// forcibly close the /dev/fuse file descriptor on a Setxattr with a | ||
// 16MB value. See TestSetxattr16MB and | ||
// https://github.com/bazil/fuse/issues/42 | ||
const maxWrite = 16 * 1024 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package fuse | ||
|
||
// Maximum file write size we are prepared to receive from the kernel. | ||
// | ||
// This number is just a guess. | ||
const maxWrite = 128 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package fuse | ||
|
||
// Maximum file write size we are prepared to receive from the kernel. | ||
// | ||
// Linux 4.2.0 has been observed to cap this value at 128kB | ||
// (FUSE_MAX_PAGES_PER_REQ=32, 4kB pages). | ||
const maxWrite = 128 * 1024 |