iwl Posted January 23, 2019 Posted January 23, 2019 When I ssh to my Banana Pi (I / A20) there is a delay of a few seconds till welcome screen / prompt. With Bananian it was instant as still is with second BananaPi with Bananian and all other kind of Pis I have, rock64 with Bananian no delay also, but faster cpu off course. Tried ssh -vvvv and a look at sshd logs, didn't found something indicating an error yet.
guidol Posted January 23, 2019 Posted January 23, 2019 42 minutes ago, iwl said: When I ssh to my Banana Pi (I / A20) there is a delay of a few seconds till welcome screen / prompt. Got such a delay only at the first ssh-login to a system or when the MicroSD-card is very slow (Class 4 to 6) or defective
iwl Posted January 23, 2019 Author Posted January 23, 2019 ~$ dd if=/dev/zero of=test.dd bs=4M count=512 512+0 records in 512+0 records out 2147483648 bytes (2.1 GB, 2.0 GiB) copied, 105.904 s, 20.3 MB/s ~$ dd if=test.dd of=/dev/null bs=4M 512+0 records in 512+0 records out 2147483648 bytes (2.1 GB, 2.0 GiB) copied, 95.5337 s, 22.5 MB/s
iwl Posted January 24, 2019 Author Posted January 24, 2019 With 20MB/s read/write the card is not defective or very slow and reason for ssh delay being the topic.
arox Posted January 24, 2019 Posted January 24, 2019 May come for bad addr to name resolution. Check your resolver.
iwl Posted January 24, 2019 Author Posted January 24, 2019 Networkanager inserts google dns 8.8.8.8 first to /etc/resolv.conf, local dns after, so bananapi armbian can't resolve own hostname. Can exchange line and resolve works then, but ssh not faster. After reboot 8.8.8.8 first again. How can I change this?
guidol Posted January 24, 2019 Posted January 24, 2019 4 hours ago, iwl said: After reboot 8.8.8.8 first again. How can I change this? the quick & dirty solution is to insert the folowing lines in /etc/rc.local before "exit 0" echo '# local nameserver' > /etc/resolv.conf echo 'nameserver 192.168.6.1' >> /etc/resolv.conf echo '# external nameserver' >> /etc/resolv.conf echo 'nameserver 8.8.8.8' >> /etc/resolv.conf I did try to deinstall the networkmanager via apt, but when it it deinstalled mostly the /etc/network/interfaces via ifupdown doesnt work (also when installed) I dont know why ifupdown / /etc/network/interfaces wont function when the networkmanager is deinstalled [EDIT] Here is how to disable NetworkManager:https://edulab.unitn.it/tecnici/how-to-disableremove-network-manager-in-ubuntu-or-debian/ Important seems to be that before rebooting/switching to /etc/network/interfaces and /etc/resolv.conf these files should be doublechecked - so that you dont loose your network-connection after restart. On my OPi PC2 I disabled the NetworkManager service, but after restart the first line of my /etc/resolv.conf is:# Generated by NetworkManager but this line wouldnt re-appear if you do remove the network-manager with apt remove network-manager (and then apt autoremove) after that the network-manager couldnt touch you /etc/resolv.con anymore
iwl Posted January 24, 2019 Author Posted January 24, 2019 cd /etc grep -r "8.8.8.8" finds resolver problem But fixing and working resolver does not fix ssh delay.
Igor Posted January 24, 2019 Posted January 24, 2019 3 hours ago, iwl said: With 20MB/s read/write the card is not defective or very slow and reason for ssh delay being the topic. Read that topic. It will explain you how wrong you are.
Igor Posted January 24, 2019 Posted January 24, 2019 4 hours ago, iwl said: With 20MB/s read/write the card is not defective or very slow and reason for ssh delay being the topic. Surely I can be wrong about this, but until you don't provide useable numbers: iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2 SD card remains on the list of suspects. Most of cards can perform solid at sequential R/W while in 4k are disastrous.
iwl Posted January 24, 2019 Author Posted January 24, 2019 Command line used: iozone -e -I -a -s 10M -r 4k -r 16k -r 1024k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write 10240 4 1883 1706 6310 6206 6243 1533 10240 16 3122 2925 15066 15129 15035 3036 10240 1024 11939 6757 22849 22852 22849 18098
iwl Posted January 24, 2019 Author Posted January 24, 2019 On my rock64: Command line used: iozone -e -I -a -s 10M -r 4k -r 16k -r 1024k -i 0 -i 1 -i 2 Output is in kBytes/sec Time Resolution = 0.000001 seconds. Processor cache size set to 1024 kBytes. Processor cache line size set to 32 bytes. File stride size set to 17 * record size. random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 10240 4 1797 1711 8031 8050 6859 1568 10240 16 1610 2039 16425 16424 15335 2000 10240 1024 6633 7163 23310 23297 23273 6384 and no significant ssh delay
Igor Posted January 24, 2019 Posted January 24, 2019 It's a very slow SD card, but I guess that should not have a role. I tried on slowest SD card which I found around: Spoiler random random kB reclen write rewrite read reread read write 10240 4 1327 1231 7615 7601 5457 794 10240 16 5537 5830 15768 13551 13847 3672 10240 1024 7030 7807 20640 20641 17731 5541 and delay is around 1s which seems normal for A20. After machine is up and idle. Ubuntu Bionic / Cubietruck http://ix.io/1z80 armbianmonitor -u was created to not waste time on finding needle in a haystack.
Igor Posted January 24, 2019 Posted January 24, 2019 Quote ssh slow http://ix.io/1z8x Logs are anonymized - there is no need to send me this on private. Nothing suspicious in the logs except this doesn't look good: [ 24.946869] print_req_error: critical medium error, dev sda, sector 0 [ 24.946884] Buffer I/O error on dev sda, logical block 0, async page read How long is this delay? More than 2sec?
iwl Posted January 24, 2019 Author Posted January 24, 2019 Error is partially broken usb harddisk, tried to shred, removed now and rebooted, don't change the problem. ~$ date; ssh -ttt xyz date Do 24. Jan 20:16:56 STD 2019 Thu Jan 24 20:17:01 CET 2019
Igor Posted January 24, 2019 Posted January 24, 2019 That's odd ... if you remove /etc/update-motd.d ?
iwl Posted January 24, 2019 Author Posted January 24, 2019 cd /etc; sudo mv update-motd.d update-motd.d._ reboot - no change in timing, no status screen on ssh login anymore
Recommended Posts