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?

9
  • Please connect your devices and put the dmesg or /var/log/syslog output here and your boot cmdline.txt for more informations, because here it is very difficult.Maybe a conlict with the ethernet gadget and the serial interface ? learn.adafruit.com/… learn.adafruit.com/… raspberrypi.stackexchange.com/questions/67907/…
    – Ephemeral
    Jun 1, 2019 at 10:05
  • As you can see on Adafruit tutorial, it is an ethernet gadget OR a serial gadget... I don't known if you can use in the the same time two gadgets. good question.
    – Ephemeral
    Jun 1, 2019 at 10:08
  • But Serial can be acceded by USB from here you see how to : hackaday.com/2016/02/25/…
    – Ephemeral
    Jun 1, 2019 at 10:12
  • You need COMPOSITE USB GADGETS. This tutorial covers emulating a keyboard, ethernet adapter, serial device, etc...
    – Ephemeral
    Jun 1, 2019 at 10:20
  • It is possible to have both ethernet and serial using g_cdc Jun 1, 2019 at 18:46

2 Answers 2

2

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
0

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.