Solaris 8: Why is netstat so slow?

  • Follow


Hi,

We have 3 servers running Solaris 8.  The netstat command on one of 
these servers runs very slowly, using about 9 seconds to print each line 
of output. iostat, sar and vmstat runs fine and reports no other activity.

Does anyone know why netstat is so slow?

Thanks in advance.

Bj�rn

-- 
The worlds fastest web server is now available
at http://highlander.metasystems.no:2000. Enjoy!
0
Reply ISO 12/17/2003 12:45:27 PM

Bj�rn Augestad wrote:
> Hi,
> 
> We have 3 servers running Solaris 8.  The netstat command on one of 
> these servers runs very slowly, using about 9 seconds to print each line 
> of output. iostat, sar and vmstat runs fine and reports no other activity.
> 
> Does anyone know why netstat is so slow?

Are you running netstat without the '-n' option?  In which case, you may 
have a problem with your DNS resolution, as netstat is doing a 
reverse-lookup on the IPs it finds.
-- 
Dave Ockwell-Jenner
Solar Nexus Solutions
http://www.solar-nexus.com/

1
Reply Dave 12/17/2003 1:09:06 PM


Dave Ockwell-Jenner wrote:

> Bj�rn Augestad wrote:
> 
>> Hi,
>>
>> We have 3 servers running Solaris 8.  The netstat command on one of 
>> these servers runs very slowly, using about 9 seconds to print each 
>> line of output. iostat, sar and vmstat runs fine and reports no other 
>> activity.
>>
>> Does anyone know why netstat is so slow?
> 
> 
> Are you running netstat without the '-n' option?  

Yes.

In which case, you may
> have a problem with your DNS resolution, as netstat is doing a 
> reverse-lookup on the IPs it finds.

Which means that I must change /etc/resolv.conf, right?

Thanks, Dave.

Bj�rn


-- 
The worlds fastest web server is now available
at http://highlander.metasystems.no:2000. Enjoy!
0
Reply ISO 12/17/2003 5:26:14 PM

On Wed, 17 Dec 2003, [ISO-8859-1] Bj?rn Augestad wrote:

> Dave Ockwell-Jenner wrote:
> > Bj?rn Augestad wrote:
> >> Does anyone know why netstat is so slow?
> >
> >
> > Are you running netstat without the '-n' option?
>
> Yes.
>
> In which case, you may
> > have a problem with your DNS resolution, as netstat is doing a
> > reverse-lookup on the IPs it finds.
>
> Which means that I must change /etc/resolv.conf, right?

.... or use -n to avoid reverse lookups

Regards,
ASK
1
Reply Sasha 12/17/2003 6:10:08 PM

Sasha wrote:
> On Wed, 17 Dec 2003, [ISO-8859-1] Bj?rn Augestad wrote:
>>Dave Ockwell-Jenner wrote:

>>>have a problem with your DNS resolution, as netstat is doing a
>>>reverse-lookup on the IPs it finds.

>>Which means that I must change /etc/resolv.conf, right?

> ... or use -n to avoid reverse lookups

Or fix your DNS server if /etc/resolv.conf is pointing to the
right place but the server is broken.

   - Logan

0
Reply Logan 12/17/2003 9:11:49 PM

<boa@metasystems.no.spam.to.me> writes:

>We have 3 servers running Solaris 8.  The netstat command on one of 
>these servers runs very slowly, using about 9 seconds to print each line 
>of output. iostat, sar and vmstat runs fine and reports no other activity.

>Does anyone know why netstat is so slow?

I use

	alias netstat 'netstat -n'

to avoid that problem.

0
Reply Neil 12/17/2003 9:51:48 PM

Roughly 12/17/03 04:45, Bj�rn Augestad's monkeys randomly typed:

> Hi,
> 
> We have 3 servers running Solaris 8.  The netstat command on one of 
> these servers runs very slowly, using about 9 seconds to print each line 
> of output. iostat, sar and vmstat runs fine and reports no other activity.
> 
> Does anyone know why netstat is so slow?

  Kinda depends on which netstat command you are using.  A common
  cause is running a netstat command that must do IP--Hostname
  lookups and this particular machine is having a hard time
  reaching the naming service. Check by setting the -n option
  on your netstat command if it allows it, to inhibit the lookups.

  May also want to try netstat -k,  or kstat [ifname]

-- 
Fan of the dumbest team in America.

0
Reply Lon 12/17/2003 11:49:09 PM

Roughly 12/17/03 13:11, Logan Shaw's monkeys randomly typed:

> Sasha wrote:
>> On Wed, 17 Dec 2003, [ISO-8859-1] Bj?rn Augestad wrote:
>>>Dave Ockwell-Jenner wrote:
> 
>>>>have a problem with your DNS resolution, as netstat is doing a
>>>>reverse-lookup on the IPs it finds.
> 
>>>Which means that I must change /etc/resolv.conf, right?
> 
>> ... or use -n to avoid reverse lookups
> 
> Or fix your DNS server if /etc/resolv.conf is pointing to the
> right place but the server is broken.
> 

  And check nsswitch.conf.  The real issue is that if your
  netstat command is being slowed down by name resolution
  problems, any application that uses hostname is also likely
  to be annoyed.

-- 
Fan of the dumbest team in America.

0
Reply Lon 12/17/2003 11:50:42 PM

Bj�rn Augestad wrote:
|
| Does anyone know why netstat is so slow?

and he received various replies that might help, but also...

One seemingly innocuous thing that a Solaris sysadmin might
do is to import information on the assignment of TCP and UDP
port numbers to network services from the Internet Assigned
Numbers Authority (http://www.iana.org/) and use it to create
a very comprehensive /etc/inet/services file, the size of 
which might be up to 600,000 bytes.        

Sad to say, Solaris netstat scans this file inefficiently, and
it slows down noticeably if the file is large.  An enhancement
to "nscd" (RFE 4140996) was proposed to alleviate this effect,
but (as far as I know) Sun has not scheduled work on it.

In my experience, netstat works OK if the /etc/inet/services
file is 40,000 bytes or smaller, but your mileage may vary. 

 ...RSS

-- 
K.L. says to try http://www.celestialseasonings.com/products/herb/r.php
which, however, contains no caffeine. 

0
Reply Richard 12/18/2003 4:33:44 AM

In article <rshu_20031217_233344@stratagy.com>,
	"Richard S. Shuford" <shuford@list.stratagy.REM0VE-THlS-PART.com> writes:
> Bj�rn Augestad wrote:
>|
>| Does anyone know why netstat is so slow?
> 
> and he received various replies that might help, but also...
> 
> One seemingly innocuous thing that a Solaris sysadmin might
> do is to import information on the assignment of TCP and UDP
> port numbers to network services from the Internet Assigned
> Numbers Authority (http://www.iana.org/) and use it to create
> a very comprehensive /etc/inet/services file, the size of 
> which might be up to 600,000 bytes.        
> 
> Sad to say, Solaris netstat scans this file inefficiently, and
> it slows down noticeably if the file is large.  An enhancement
> to "nscd" (RFE 4140996) was proposed to alleviate this effect,
> but (as far as I know) Sun has not scheduled work on it.
> 
> In my experience, netstat works OK if the /etc/inet/services
> file is 40,000 bytes or smaller, but your mileage may vary. 
> 

If you're running NIS, a workaround is to change the nsswitch.conf
entry to

services:   nis [NOTFOUND=return] files

which although not a good idea with a small services file is faster
with a large one.

-- 
mailto:rlhamil@smart.net  http://www.smart.net/~rlhamil
0
Reply Richard 12/18/2003 4:43:45 PM

9 Replies
1474 Views

(page loaded in 0.111 seconds)

Similiar Articles:













7/20/2012 6:48:41 AM


Reply: