1

I have installed

  • postfix
  • dovecot
  • fail2ban
  • postgray

daemons on top of the Linux mail 4.14.98+ #1200 Tue Feb 12 20:11:02 GMT 2019 armv6l GNU/Linux

Also, I have connected rpi0 to another rpi over usb-otg (to have a serial and ethernet access).

Unfortunately, even though rpi0 has low load, when ssh to it, every typing takes seconds, and in lot cases connection break due to timeout.

  CPU[#*                        3.2%]   Tasks: 54, 17 thr; 1 running
  Mem[|||||||####*********87.6M/433M]   Load average: 0.02 0.04 0.05
  Swp[                         0K/0K]   Uptime: 23 days, 02:36:02

When I connect to rpi0 via serial link - everything works fine, no delays, no timeouts.

So, question is -- which software may cause a delay?

Andrii Zhuk
  • 11
  • 1
  • 2

2 Answers2

3

Uncommenting the following line in /etc/ssh/sshd_config did the trick for me, and my ssh session were not slow anymore afterwards:

UseDNS no

Don't forget to restart the ssh service after modifying the config file:

service ssh restart
1

UseDNS didn't help me. What finally did was to go into the pi's ssh_conf and sshd_conf and add

IPQoS 0x00

It is suggested that an alternative might be to add

-o IPQoS=0

to the client's ssh command line, and that it might be worth changing that value from 0 to throughput.

Basically, open-ssh tries to use the Quality of Service figure for the connection to optimize its performance... and the default assumes a reliability that the Pi Zero W, with its weak WiFi hardware, can't reliably achieve. That causes long timeouts and loss of connection. Setting IPQoS to "we know it's a bad connection" makes the protocol less efficient but lets it recover from problems much more quickly.

Hope this helps others. Now I need to look up the packet-level details of what this setting does to the SSH protocol...

keshlam
  • 211
  • 1
  • 10