slow login with SSH, SQLPLus, lsnrctl?

In this post I would like to share two slow login issues which are a bit annoying and not easy to track down.

  1. Slow login into a server from via SSH.

When using a SSH client to remote in a server, after typing in the user name, it takes 20~30 seconds or even longer to prompt for the password, since you haven’t logged in yet, how would you trouble shoot this? Frankly I was not sure where to start. All I knew was something not quite right on the server. I tried to put sshd on debug then login to see what’s in the log. It didn’t really indicate anything.

Fortunately while I was looking around, I noticed the DNS servers configured in /etc/resolve.conf were wrong. After I corrected that, login was fast.

I then have realized sshd does have an option UseDNS. You can see the explaination from “man 5 sshd_config“.

UseDNS Specifies whether sshd(8) should look up the remote host name, and to check that the resolved host name for the remote IP address maps back to the very same IP address. The default is “yes”.

For Redhat distributions, by default it is set to “YES”. You can imagine that when DNS is not reachable, the delay it causes.

2. Slow login into SQLPlus or “lsnrctl status” returns slow

This is another interesting issue. While I was connecting a database via SQLPLus on a new build server itself, it was slow which took about 10~30 seconds to login instead of login instantly. So I tried to launch SQLPlus first with “sqlplus /nolog”, then try to connect — slowness coming at this step.

Interestingly enough, I also noticed that “lsnrctl status” took 10+ seconds to response. After poking around, it turned out there was an entry for the hostname without IP configured in the file “/etc/hosts“. That was the result of a faulty automatic configuration script. And the hostname was not resovlable in DNS too. That caused the delay. After I put the IP for the hostname in the “/etc/hosts“, the issue has gone.

Good lessons learned, whenever there is a delay, the first place to check is either DNS reachable or hostname resolvable.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s