Re: ssh / remsh slow (128 Views)
Reply
Valued Contributor
Avinash Agarkar
Posts: 225
Registered: ‎10-26-2006
Message 1 of 6 (192 Views)

ssh / remsh slow

Here is the actual delay which we can see in “ssh/remsh” connection as of now, “wtmps” files on the target host  is just  “79kb” still ssh / remsh connection is slow towards this host.

Rest of the machines it hardly takes “0.90” or “1” sec for ssh / remsh login.

 

 

 

[]> timex ssh host date

Mon Jun  9 09:56:55 PDT 2014

 

real       21.65

user        0.09

sys         0.02

 

[]> timex ssh host date

Mon Jun  9 09:57:18 PDT 2014

 

real       21.86

user        0.09

sys         0.02

 

[]> timex remsh host dat

Mon Jun  9 10:03:47 PDT 2014

 

real        8.81

user        0.00

sys         0.01

 

[]> timex remsh host dat

Mon Jun  9 10:04:30 PDT 2014

 

real        8.97

user        0.00

sys         0.01

 

Thanks,

Avinash

Great Power Comes With Great Responsibility
Honored Contributor
Bill Hassell
Posts: 14,210
Registered: ‎05-29-2000
Message 2 of 6 (184 Views)

Re: ssh / remsh slow

Since the task you are requesting is very short (ie, date), the delay is likely due to network name resolution. If you have never changed the nsswitch.conf file, change it to this:

 

passwd:       files
group:        files
hosts:        files [NOTFOUND=continue UNAVAIL=continue] dns
ipnodes:      files [NOTFOUND=continue UNAVAIL=continue] dns
services:     files
networks:     files
protocols:    files
rpc:          files
publickey:    files
netgroup:     files
automount:    files
aliases:      files

 Then, add the IP address and hostnames that you will be contacting to /etc/hosts. This should eliminate the startup delays. A typical ssh number is 1.5 to 2.0 seconds, for remsh, timex should report 0.3 to 0.6 seconds.

 

 # timex ssh atl6 date
Mon Jun  9 18:50:42 EDT 2014

real        1.44
user        0.13
sys         0.03


# timex remsh atl6 date
Mon Jun  9 18:51:58 EDT 2014

real        0.29
user        0.00
sys         0.01

 



 

Valued Contributor
Avinash Agarkar
Posts: 225
Registered: ‎10-26-2006
Message 3 of 6 (177 Views)

Re: ssh / remsh slow

Hi,

 

It's not only for date it is happening for each and every command which we are runnig remotely on target host.

 

Alos ssh login itself is taking 10 to 21 sec whcih is bad.

 

we are using dns and nsswitch.conf file is already upto date like you mentioned.

hosts:        files [TRYAGAIN=continue NOTFOUND=continue UNAVAIL=continue] dns

ipnodes:        files [TRYAGAIN=continue NOTFOUND=continue UNAVAIL=continue] dns

 

Thanks,

Avinash

Great Power Comes With Great Responsibility
Acclaimed Contributor
Dennis Handly
Posts: 25,186
Registered: ‎03-06-2006
Message 4 of 6 (166 Views)

Re: ssh / remsh slow

>It's not only for date it is happening for each and every command which we are running remotely

 

The delay would be for every command.  Unless the command is a giant application which would need to be paged in and have even more delay.  This latter delay would be even if you were local to that server.

Honored Contributor
Bill Hassell
Posts: 14,210
Registered: ‎05-29-2000
Message 5 of 6 (162 Views)

Re: ssh / remsh slow

This is a classic hostname delay symptom. The negotiation to perform a login is being slowed by a bad networking setup. Try telnet and see if you immediate response to a login. Also, run nsquery to see how the hostname is being resolved:

 

nsquery hosts remote-hostname

and

nsquery hosts 12.34.56.78

 

Also try remsh and ssh with the IP address. And for .rhosts on the remote system, put both the hostname as well as the IP address. If the IP address is fast, I would take a look at /etc/resolv.conf for some incorrect or obsolete domain names as well aas non-working IP addresses for DNS servers.

Honored Contributor
Steven Schweda
Posts: 9,091
Registered: ‎02-23-2005
Message 6 of 6 (128 Views)

Re: ssh / remsh slow

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.