Skip to content

Commit

Permalink
sshfs: fix another instance preventing use of global I/O size on macOS (
Browse files Browse the repository at this point in the history
#185)

Following-up on [1], there was another instance where blksize
was set to a non-zero value, thus making it impossible to
configure global I/O size on macOS, and using [2] the hard-wired
value of 4096 bytes instead, resulting in uniformly poor
performance [3].

With this patch, setting I/O size to a reasonable large value,
will result in much improved performance, e.g.:
  -o iosize=1048576

[1] osxfuse/sshfs@5c0dbfe
[2] https://github.com/libfuse/sshfs/blob/4c21d696e9d46bebae0a936e2aec72326c5954ea/sshfs.c#L812
[3] #11 (comment)
  • Loading branch information
vszakats authored and Nikratio committed Sep 12, 2019
1 parent 4c21d69 commit 667cf34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3920,7 +3920,11 @@ int main(int argc, char *argv[])
}
#endif /* __APPLE__ */

#ifdef __APPLE__
sshfs.blksize = 0;
#else
sshfs.blksize = 4096;
#endif
/* SFTP spec says all servers should allow at least 32k I/O */
sshfs.max_read = 32768;
sshfs.max_write = 32768;
Expand Down

0 comments on commit 667cf34

Please sign in to comment.