1748122 Members
3501 Online
108758 Solutions
New Discussion

Re: ssh / remsh slow

 
Avinash Agarkar
Valued Contributor

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
5 REPLIES 5
Bill Hassell
Honored Contributor

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

 



 



Bill Hassell, sysadmin
Avinash Agarkar
Valued Contributor

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
Dennis Handly
Acclaimed Contributor

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.

Bill Hassell
Honored Contributor

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.



Bill Hassell, sysadmin
Steven Schweda
Honored Contributor

Re: ssh / remsh slow