tomdean
Posts: 28
Joined: Tue Feb 19, 2013 4:02 am

SSH frequenly pauses

Fri Oct 02, 2015 8:49 pm

I normally ssh from a linux desktop to the RPi B+. I do not use WiFi, having a cable connection.

I have been experiencing frequent pauses on the order of 10 to 40 seconds, after some time in minutes. The interval between pauses seems to be related to activity. But, happens at least one time per 5 to 10 minutes.

On the RPi, I started
ping -i 10 182.168.2.1
and, have not seen a pause since.

It seems something, network, sshd, ???, is going to sleep, most likely on the RPi.

If I ssh from my linux desktop to another linux desktop, I do not see the pauses.

Any ideas?

Tom Dean

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: SSH frequenly pauses

Sat Oct 03, 2015 11:05 pm

Sounds more like a networking thing to me, arp table being flushed, router redirection timing out or something.
The ping is likely keeping the network 'warm'.

quick test: ssh in and run

Code: Select all

while uptime ; do sleep 10 ; done
and see if the pauses happen (i.e. use ssh rather than ping to keep the network ticking over)

Check out ssh keepalive.

underachiever
Posts: 3
Joined: Fri Jun 20, 2014 6:16 pm

Re: SSH frequenly pauses

Sat Oct 10, 2015 3:38 pm

Same here, I suspected it's the network, but it's not - pings are flawless.
I tried a bunch of things (disable firewall, check hosts.allow and hosts.deny, etc.) but SSH server still goes down every 5 minutes and stays down for about 1 minute, then I can SSH to it again.

My client is both Putty (latest stable) and OpenSSH client on Pi B (Raspbian).
My Pi 2 where OpenSSH server is is also Raspbian.

Something in the latest round of package updates screwed things up.
I had this Pi 2 working just fine until couple of days ago.

I should mention this is "OpenSSH_6.7p1" and (related to the comment) the problem is not that SSH isn't kept alive, but that it drops even if you're working in the shell, and if you try to connect you get:
ssh: connect to host <IP> port 22: Connection refused

Then you need to wait around 1 minute before you can SSH to the box again. During that time the network is up and the host is pingable, but you get "connection refused". Huge time waste.

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: SSH frequenly pauses

Sat Oct 10, 2015 9:24 pm

Anything in the logs? dmesg? system load?
any disks that could be timing out (dodgy USB connections, flaky NFS server?)

ICMP-PING is handled way down in the networking stack whereas ssh needs access to all sorts of files.
I've seen behaviour like this when a system has been flat-out flushing disk caches etc., the memory-resident PING code runs just fine but anything that needs disk access stalls.

Return to “Troubleshooting”