Situation
I have two web servers that connect to a file repository over sshfs:
/usr/bin/sshfs -f -o reconnect -o follow_symlinks -o allow_other \
repo@files3:/var/repo /var/repo
On one web server this mount point can be used with "normal" speed, but on the other web server any operation on the mounted folder takes a long time, for example:
user@good-server$ time ls /var/repo/big-folder > /dev/null
real 0m0.513s
user 0m0.091s
sys 0m0.048s
vs
user@bad-server$ time ls /var/repo/big-folder > /dev/null
real 0m15.414s
user 0m0.049s
sys 0m0.006s
I can reproduce this slowness with plain ssh (e.g. time ( for i in {1..10}; do ssh repo@files3 true; done)
takes 1.5 vs 7 seconds).
Dead ends
I have a mirrored backup server of the files3 (called files4) for which I can reproduce the slowness with the bad webserver and the speed with the good webserver. So I conclude that the problem is on the ssh client not the server. The /etc/ssh/sshd_config
is the same on all four servers though. All the machines are also listed in each others /etc/hosts
files with ipv4 and ipv6 address (mentioning this due to SSH connection slow from one machine but not another and Improving SSHFS performance when reflecting changes in host directory).
Question
What could be the cause or how can I go about debugging this?