Operating System - HP-UX
1819791 Members
3218 Online
109607 Solutions
New Discussion юеВ

lsof display is very slow

 
Y.J.JIN
Advisor

lsof display is very slow

Hi,

We have 5 rp5470 running with 11i.
cpu 4G,memory 8gb

Execute lsof command with one machine,display is very slow. it will begin to display it in about one minute.

lsof version is 4.74.
compiled with local machine.

copy binary to another machine,it is OK.
waiting time is not caused.

what's problems ? kernel ? patch ?

Thanks in advance.
8 REPLIES 8
Robert-Jan Goossens_1
Honored Contributor

Re: lsof display is very slow

Hi,

Try the -n option.

# lsof -n

---
-n This option inhibits the conversion of network numbers to host names for network files. Inhibiting conversion may make lsof run faster. It is also useful when host name lookup is not working properly.
---
Regards,
Robert-Jan
Ermin Borovac
Honored Contributor

Re: lsof display is very slow

One thing that springs to mind is name/IP resolution.

Can you try running lsof with -n switch?

-n
This option inhibits the conversion of network numbers to host names for network files. Inhibiting conversion may make lsof run faster. It is also useful when host name lookup is not working properly.
Joseph Loo
Honored Contributor

Re: lsof display is very slow

hi,

did u take the binary 4.74, i.e. lsof_4.74.gz from here:

http://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/binaries/hpux/B.11.11/

regards.
what you do not see does not mean you should not believe
Y.J.JIN
Advisor

Re: lsof display is very slow

Hello,

Thanks for your answers.

lsof is compiled with a real machine.

it became about ten seconds earlier with -n option.
but it is still slow.

Kind Regards




harry d brown jr
Honored Contributor

Re: lsof display is very slow

Like stated before by Robert-Jan and Ermin, you probably have a DNS issue.

What does nslookup 127.0.0.1 return?

Are you running lsof as root?

can you post your /etc/resolv.conf and /etc/nsswitch.conf files?


live free or die
harry d brown jr
Live Free or Die
Ermin Borovac
Honored Contributor

Re: lsof display is very slow

Do you have any NFS mounts on this system? If yes, does bdf return reasonably quickly?

Does it hang when you run it on a single file only?

# lsof /etc/utmp

You may want to try running lsof with the following option to try to isolate the problem.

-P no port names
-l list UID numbers
-C no kernel name cache
-b avoid kernel blocks
-M portMap registration

Failing all that you can try using tusc to determine why it hangs.
Y.J.JIN
Advisor

Re: lsof display is very slow

Hi,


-----------------------
# nslookup 127.0.0.1
Using /etc/hosts on: HOSTNAME

looking up FILES
Name: localhost
Address: 127.0.0.1
Aliases: loopback

-----------------------
# cat nsswitch.conf
#
# /etc/nsswitch.files:
#
# @(#)B.11.11_LR
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any name services.
#
passwd: files
group: files
hosts: files
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files

------------------------


resolv.conf file is not set.

The result was the same for the file of one.

perhaps, because the VM free memory(200M) is considerably little, I think that this is a
cause.

Kind Regards
Y.J
Y.J.JIN
Advisor

Re: lsof display is very slow

thanks