LazyWestCoaster
Posts: 7
Joined: Sat Aug 13, 2016 9:06 pm

SSH Slow to respond

Wed Aug 17, 2016 9:17 pm

Up until recently, logging into my Raspberry Pi via ssh was very smooth, but now it's really slow. Firstly, it takes me a few seconds, even minutes for my password to be accepted. Also, it takes a few seconds for the text to appear when I enter commands. From what I have researched, this could be caused by some form of latency (possibly from having multiple devices on a network), and some of the solutions I have tried (like adding "UseDNS no" to etc/ssh/sshd_config) could help, but I have seen nothing different so far. I'm still learning a lot about the terminal/troubleshooting common issues. Any suggestions would be helpful.

Thanks

wh7qq
Posts: 1326
Joined: Thu Oct 09, 2014 2:50 am

Re: SSH Slow to respond

Thu Aug 18, 2016 1:18 am

I wish I had an answer to this. I did try the UseDNS no addition to /etc/ssh/sshd_config and then rebooted. So far, the response to ssh has been immediate. Time will tell.

Still, the ping times from the router to this client (a RPi B+ with an Edimax USB wifi dongle) are all over the map, from about 5msec to over 300msec. The router is an Asus RT-N66U about 30' away from the B+ with a wood frame/plaster board closet in between. It is an isolated area with no other wifi networks around. Increasing the power output on the router has no effect on ping response.

wh7qq
Posts: 1326
Joined: Thu Oct 09, 2014 2:50 am

Re: SSH Slow to respond

Thu Aug 18, 2016 2:36 am

So far, so good on the response time. I'll update tomorrow if I remember.

As to the ping times, in looking over the wifi troubleshoting sticky in this forum, I saw a suggestion to use 20 Mhz bandwidth (not 40 MHz), Seems to have helped some: pings from the B+ to the router are fast and consistant:

Code: Select all

19 packets transmitted, 19 received, 0% packet loss, time 18027ms
rtt min/avg/max/mdev = 2.935/5.439/6.013/0.657 ms
but not so great (but better) from router to B+:

Code: Select all

Round-Trip: 5.697 min, 61.404 avg, 216.896 max (ms)
   Packets: 20 transmitted, 20 received, 0% lost

wh7qq
Posts: 1326
Joined: Thu Oct 09, 2014 2:50 am

Re: SSH Slow to respond

Fri Aug 19, 2016 2:11 am

Responded to ssh on first try with no delay today.

maurice1
Posts: 37
Joined: Tue Mar 05, 2013 8:55 am
Location: Dublin

Re: SSH Slow to respond

Mon Aug 22, 2016 8:20 am

Could it be something else on your lan trying to use the same ip address and the asus is confused. Think I had a similar problem a long time ago switching sd cards between rpis.

jogl
Posts: 93
Joined: Sun Mar 13, 2016 12:02 pm
Location: SW Ontario Canada

Re: SSH Slow to respond

Mon Aug 22, 2016 10:00 am

As maurice1 mentioned, I have had similar issues when there were IP and/or MAC address conflicts on the LAN.

wh7qq
Posts: 1326
Joined: Thu Oct 09, 2014 2:50 am

Re: SSH Slow to respond

Mon Aug 22, 2016 4:34 pm

The response to ssh was immediate this am and the ping times were as low as I have seen.

Code: Select all

useDNS no
seems to have cured the response delay

Using the 20 MB bandwidth seems to have cured the B+ to router ping times

Code: Select all

--- 192.168.1.1 ping statistics ---
22 packets transmitted, 22 received, 0% packet loss, time 21031ms
rtt min/avg/max/mdev = 3.593/6.164/11.962/1.642 ms
but router ping back to B+ still is all over the place:

Code: Select all

--- 192.168.1.11 ping statistics ---
17 packets transmitted, 17 packets received, 0% packet loss
round-trip min/avg/max = 1.526/59.133/212.811 ms

LazyWestCoaster
Posts: 7
Joined: Sat Aug 13, 2016 9:06 pm

Re: SSH Slow to respond

Mon Aug 22, 2016 5:17 pm

Oh man! I'm really sorry I am so slow to get back to this. I had a visiting friend on vacation and the past weekend was crazy. (Off Topic)

So at the moment, SSH seems to be running fine, and I don't know why. I did try the UseDNS no, but I am not sure if that worked. I'm taking a look at these posts right now, and I am going to look into each one as additional troubleshooting measures to try in the event my latency picks back up again. I had no idea I was getting this many posts. Thanks for your kind replies!!

LazyWestCoaster
Posts: 7
Joined: Sat Aug 13, 2016 9:06 pm

Re: SSH Slow to respond

Mon Aug 22, 2016 7:37 pm

So time will tell, but it appears my latency issues have passed. Pinging from my pi ranges between 4-8MS. I'm a newbie, so I'm not entirely sure if that's good or bad, but my latency issues for the time being are much more manageable. Thanks for your replies and help guys.

Return to “Troubleshooting”