Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Apr 2001 10:00:21 +0200
From:      Joachim =?iso-8859-1?Q?Str=F6mbergson?= <watchman@ludd.luth.se>
To:        Nik Clayton <nik@FreeBSD.ORG>
Cc:        doc@FreeBSD.ORG
Subject:   Suggested adendum to FAQ section 3.22
Message-ID:  <3AD6B215.189906@ludd.luth.se>
References:  <20010404182156.C86363@canyon.nothing-going-on.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Aloha!

Thanks to Niks "Weekly FAQ changes mail" I saw the added question in the
FAQ about slow ssh and telnet connection. I had this problem and I found
this section did not contain the solution to my version of the problems,
So, I would like to suggest an addition to that section.

Section 3.22 reads:
<quote>
3.22. Why does it take so long to connect to my computer via ssh(1) or
telnet(1)?

The symptom: there is a long delay between the time the TCP connection
is established and the time when the client software asks for a password
(or, in
telnet(1)'s case, when a login prompt appears).

The problem: more likely than not, the delay is caused by the server
software trying to resolve the client's IP address into a hostname. Many
servers, including
the Telnet and SSH servers that come with FreeBSD, do this in order to,
among other things, store the hostname in a log file for future
reference by the
administrator.

The remedy: if the problem occurs whenever you connect from your
computer (the client) to any server, the problem is with the client;
likewise, if the problem
only occurs when someone connects to your computer (the server) the
problem is with the server.

If the problem is with the client, the only remedy is to fix the DNS so
the server can resolve it. If this is on a local network, consider it a
server problem and keep
reading; conversely, if this is on the global Internet, you will most
likely need to contact your ISP and ask them to fix it for you.
</quote>


Problem discussion:
-------------------
First off - a question: Wouldn't the same problem affect ftp, http and
ping to the same host - that is a name resolution problem should affect
all connection types, not only telnet or ssh, no?

For me I had the behaviour described in 3.22. The problem was that the
sites I tried to connect to belonged to some of the bigger sites on the
net, and the DNSs I use are also among the bigger ones (my ISP is the
biggest ISP in the country). It was also pretty easy to do a name lookup
and find the correct name and IP-number for the hosts I tried to SSH or
Telnet to.

Furthermore, ftp worked nicely, whereas telnet to port 21 didn't.
Running ktrace while running ssh and telnet suggested common libraries.
The solution found was to do a buildworld/installworld so that libraries
and binaries were updated. Now, ssh and telnet runs fine.


Analysis of my faulty ways:
---------------------------
(1) I had used -O3 optimization for the last version of system upgrade.
Yes, this is BAD. No, it won't happen again. This could very well be the
reason for the behaviour.

(2) I update the cvs-tree and make buildworld on a weekly basis, but
update the system very much more rarely. The kernel however have been
updated due to added HW and such things. Since the kernel sources have
been updated, some problems due to kernel and system is out of sync
might be responsible.


Suggested addendum:
-------------------
If the DNS entries seemes to be in order make sure that your system have
been updated and/or the kernel is in sync with the system. If not, see
the handbook section <xxx.yy> for ways to update the system. For
information about compiler optimization settings, see <mmm,nnn>.

If your system is in sync and up to date, please ensure that the system
have been built without compiler optimizations that can generate faulty
code. Check in /etc/make.conf and ensure that the optimization flag is
set to at most -O2, or that the CFLAGS and COPTFLAGS have been commented
out.



Comments, suggestions are highly welcome. Yes, I know I messed up on the
optimization bit, I know that's a no-no. I'm pretty sure thhough I'm not
the first nor last person that will make that mistake - and possibly
learn from it by reading section 3.22.

-- 
Cheers!
Joachim - Alltid i harmonisk svängning
--- FairLight ------ FairLight ------ FairLight ------ FairLight ---
Joachim Strömbergson         ASIC SoC designer, nice to CUTE animals
Phone: +46(0)31 - 27 98 47    Web: http://www.ludd.luth.se/~watchman
--------------- Spamfodder: regeringen@regeringen.se ---------------

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AD6B215.189906>