Sunday, January 27, 2013

Login delays



su - < nis user> is taking a long time ( more than 20 sec )


Some introduction to the problem:

When is the slowness observed su only or even with telnet and ssh?

Answer: Even telnet and ssh is slow. Basically “su - ” is taking long time for all the user.

When slowness is observed,is it just before you get logged in or even after that with commands?

Answer: Only the login is very slow. Once login everything looks normal.


(MySolaris:/)# time su - schweitz -c "hostname"
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

#############################################################
# This server is using NIS 
#############################################################
MySolaris

real 0m20.180s
user 0m0.040s
sys 0m0.070s
(MySolaris:/)#


First test:

Difference in time between "su schweitz" and "su - schweitz".

With "su - username" the HOME directory has to be mounted and the shell profiles (system and user specific) get executed. (sh,ksh: /etc/profile, $HOME/.profile; for C-shell ist equivalent). May be those profiles contain command wich run slow (like 'quota').

(MySolaris:/)# time su schweitz -c "hostname"
(MySolaris:/)# time su - schweitz -c "hostname"

su is working fine. su - is taking long time

Second Test:

All users have csh as its shell

rename /etc/.login (used by csh") :
# mv /etc/.login /etc/.login.not

Then test "su - xxx" :
# time su - schweitz -c "hostname"

after moving the /etc/.login, it is indeed fast

(MySolaris:/)# time su - schweitz -c "hostname"
MySolaris

real 0m0.055s
user 0m0.016s
sys 0m0.027s
(MySolaris:/)# 

The real problem:

In the resultant truss output, it was noted that quota command takes more than 20 sec. 
So issue seems to be with quota command. The "quota" command also checks NFS mounted file systems. One of the NFS servers seems not to respond. So removed an NFS mount and then the su was fast. 

The 20 sec delay is caused by checking quotas on NFS mounted file systems; it occurs when some NFS server does not respond.


No comments:

Post a Comment