1832091 Members
2915 Online
110038 Solutions
New Discussion

netstat commands slow

 
Jerry_109
Super Advisor

netstat commands slow

HP-UX B.11.11 U 9000/800/rp3410

Hello All,

Anyone understand why some of my netstat commands ( netstat -i or netstat -a )are slow ?
I have to wait almost 70 seconds for output.
Other netstat commands ( netatat -rn or netstat -n ) seems to work fine. Please advise,
Thanks

Jerry Sims
jlsims@scif.com
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: netstat commands slow

Maybe the DNS server is slow.

Check communication with them by pinging or running nslookup/dig commands to the servers defined in /etc/resolv.conf

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
KapilRaj
Honored Contributor

Re: netstat commands slow

DNS issue ... it tries to resolve the ip;s to names

Kaps
Nothing is impossible
Ron Kinner
Honored Contributor

Re: netstat commands slow

It's normal for them to be slow. Without the -n option every IP address has to go through the DNS to get its name. This takes time plus if a few of them don't have names or your DNS doesn't respond then you have to wait for the timeout to find it out. If you are working with a finite set of addresses then you could speed things up by putting them in the /etc/hosts file but if the internet is involved then the -n is your only option assuming your DNS even does reverse lookups.

To test your DNS just do

nslookup att.com
this should give you:
192.20.5.55

but a netstat command has to work in the other direction so try:

nslookup 192.20.5.55

Do you get att.com or does it just time out?


DNS request timed out.
timeout was 2 seconds.

Not every local DNS is set up to give reverse lookups. With a 2 second timeout on each request you can easily calculate the minimum delay by multiplying the number of lookups required by 2 seconds each.

Ron

Jerry_109
Super Advisor

Re: netstat commands slow

root@airlock[/root]
# nslookup airlock
The nslookup for the hostname seems to work
in both directions. Hostname is "airlock"

Name Server: hodc01.scif.com
Address: 10.2.19.151

Trying DNS
Name: airlock.scif.com
Address: 10.2.110.200

root@airlock[/root]
# nslookup 10.2.110.200
Name Server: hodc01.scif.com
Address: 10.2.19.151

Trying DNS
Name: airlock.scif.com
Address: 10.2.110.200
Tim D Fulford
Honored Contributor

Re: netstat commands slow

try
# netstat -in

then
# netstat -i

If the second is slower it is because your resolution method is slow (DNS, NIS etc).

Regards

Tim
-
Muthukumar_5
Honored Contributor

Re: netstat commands slow

Please post /etc/nsswitch.conf, /etc/resolv.conf and /etc/hosts file entries.

HTH.
Easy to suggest when don't know about the problem!
harry d brown jr
Honored Contributor

Re: netstat commands slow

make your hp box a dns caching server.

Install bind 9.2.x (from software.hp.com)

then try this thread - my post on setting it up (see the attachment there).
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=840826

live free or die
harry d brown jr
Live Free or Die
Jerry_109
Super Advisor

Re: netstat commands slow

HP-UX B.11.11 U 9000/800/rp3410

The (2) lan cards are configured for different subnets between "prod/dev" and "test lab" as follows:
lan0 for prod/dev servers 10.2 network
lan1 for test lab servers 10.254 network

Please review the following information I have gathered :

***********************************************
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
lan 0 0/1/2/0 igelan CLAIMED INTERFACE HP PCI 1000Base-T Core
lan 1 0/4/1/0 btlan CLAIMED INTERFACE HP A5230A/B5509BA PCI 10/100Base-TX Addon
********************************************
# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/1/2/0 0x00306E4B2183 0 UP lan0 snap0 1 ETHER Yes 119
0/4/1/0 0x00306EEA664A 1 UP lan1 snap1 2 ETHER Yes 119
***************************************
# ifconfig lan0
lan0: flags=1843
inet 10.2.110.200 netmask ffff0000 broadcast 10.2.255.255
root@airlock[/tmp]
# ifconfig lan1
lan1: flags=843
inet 10.254.110.2 netmask ffff0000 broadcast 10.254.255.255
*****************************************

# lanadmin -x 0
Speed = 100 Full-Duplex.
Autonegotiation = Off.

root@airlock[/tmp]
# lanadmin -x 1
Current Config = 100 Full-Duplex MANUAL
***********************************

# The HP_IGELAN_INIT_ARGS are reserved by HP. They are NOT user changable.

HP_IGELAN_INIT_ARGS="HP_IGELAN_STATION_ADDRESS HP_IGELAN_SPEED HP_IGELAN_MTU HP_IGELAN_FLOW_CONTROL HP_IGELAN_AUT
ONEG HP_IGELAN_SEND_COAL_TICKS HP_IGELAN_RECV_COAL_TICKS HP_IGELAN_SEND_MAX_BUFS HP_IGELAN_RECV_MAX_BUFS"

HP_IGELAN_INTERFACE_NAME[0]=lan0
HP_IGELAN_STATION_ADDRESS[0]=
HP_IGELAN_SPEED[0]=100FD
HP_IGELAN_MTU[0]=
HP_IGELAN_FLOW_CONTROL[0]=
HP_IGELAN_AUTONEG[0]=
HP_IGELAN_SEND_COAL_TICKS[0]=
HP_IGELAN_RECV_COAL_TICKS[0]=
HP_IGELAN_SEND_MAX_BUFS[0]=
HP_IGELAN_RECV_MAX_BUFS[0]=

# End of hpigelanconf configuration file

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

HP_BTLAN_INTERFACE_NAME[0]=lan1
HP_BTLAN_STATION_ADDRESS[0]=
HP_BTLAN_SPEED[0]=100FD
HP_BTLAN_INIT_ARGS="HP_BTLAN_STATION_ADDRESS HP_BTLAN_SPEED"

# End of hpbtlanconf configuration file
*********************************************
Jerry_109
Super Advisor

Re: netstat commands slow

Problen has been resolved as follows :

someone changed the "resolv.conf" to allow
"ldap" execution. I changed the file back to:
passwd: files
group: files
hosts: files [NOTFOUND=continue] dns
services: files
networks: files
protocols: files
rpc: files
publickey: files
netgroup: files
automount: files
aliases: files

All seems fine now. Thanks all for helping.
if I had given more information earlier. we might have fixed this problem sooner. Thanks
Jerry