aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTimo Savola <timo.savola@iki.fi>2017-10-14 17:36:36 +0300
committerNikolaus Rath <Nikolaus@rath.org>2019-11-24 12:01:01 +0000
commit8822b60d9dbd9907065e7999f616b11ddce6d584 (patch)
tree25105ae29ec31475bb9a484389905aaf41e3922f /test
parent0f3ab4fd4f65412f2ee8d6a96b385e683edbfaea (diff)
downloadsshfs-8822b60d9dbd9907065e7999f616b11ddce6d584.tar
sshfs-8822b60d9dbd9907065e7999f616b11ddce6d584.tar.gz
sshfs-8822b60d9dbd9907065e7999f616b11ddce6d584.tar.bz2
sshfs-8822b60d9dbd9907065e7999f616b11ddce6d584.zip
Add support for using multiple connections
The -o max_conns=N option causes multiple SSH processes and response processing threads to be created. This means that e.g. reading a large file no longer blocks all access to the filesystem. The connection is chosen by checking the per-connection statistics: 1. Choose connection with least outstanding requests; if it's a tie, 2. choose connection with least directory handles; if it's a tie, 3. choose connection with least file handles; if it's a tie, 4. choose connection which has already been established. The implementation assumes that the max_conns values will be small; it uses linear search. Example benchmark: With single connection: $ sshfs -o max_conns=1,workaround=nobuflimit ebox: mnt $ cat mnt/tmp/bigfile > /dev/null & $ time find mnt > /dev/null real 1m50.432s user 0m0.133s sys 0m0.467s With multiple connections: $ ~/in-progress/sshfs/build/sshfs -o max_conns=5,workaround=nobuflimit ebox: mnt $ cat mnt/tmp/bigfile > /dev/null & $ time find mnt > /dev/null real 1m15.338s user 0m0.142s sys 0m0.491s This feature was implemented to large extend by Timo Savola <timo.savola@iki.fi>. Thanks to CEA.fr for sponsoring the remaining work to complete this feature and integrate it into SSHFS!
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_sshfs.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_sshfs.py b/test/test_sshfs.py
index 995ff00..d873a63 100755
--- a/test/test_sshfs.py
+++ b/test/test_sshfs.py
@@ -33,7 +33,8 @@ def name_generator(__ctr=[0]):
@pytest.mark.parametrize("debug", (False, True))
@pytest.mark.parametrize("cache_timeout", (0,1))
@pytest.mark.parametrize("sync_rd", (True, False))
-def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, capfd):
+@pytest.mark.parametrize("multiconn", (True,False))
+def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, multiconn, capfd):
# Avoid false positives from debug messages
#if debug:
@@ -77,6 +78,9 @@ def test_sshfs(tmpdir, debug, cache_timeout, sync_rd, capfd):
cmdline += [ '-o', 'entry_timeout=0',
'-o', 'attr_timeout=0' ]
+ if multiconn:
+ cmdline += [ '-o', 'max_conns=3',
+ '-o', 'workaround=nobuflimit' ]
new_env = dict(os.environ) # copy, don't modify