Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to measure the performance of NIC?

Status
Not open for further replies.

wagsy22

IS-IT--Management
Joined
Apr 6, 2004
Messages
2
Location
US
I need to determine how much of 1000Mbps interface is being used at any point in time. For instance, I would like to know if we are using 50, 60, or 70% of the bandwidth which comes with gigabit interface at any time within a 24 hour period. I do not need to measure bandwidth or latency but tools to measure this and convert the output to something in Mb would be useful instead of all the cryptic output you get with nfsstat or netstat.

Any help is greatly appreciated....

Wagsy
 
I use the Kstat module in Suns perl (available since Solaris 8) to get the counter of transfered bytes (in this case a 32bit counter) and dump the values to a COUNTER DS in a rrdtools database (google for rrdtool, DO IT! You'll get value history and nice graphs). You could also take two samples in a given amount of time and calculate the average rate.

Code:
#!/usr/bin/perl -w
# A quick and dirty example ... writing from memory
# How to get RxBytes and TxBytes of interface ce0

use Sun::Solaris::Kstat;

my $Kstat = Sun::Solaris::Kstat->new();

my $ce0rbytes1 = $Kstat->{ce}->{0}->{ce0}->{rbytes};
my $ce0obytes1 = $Kstat->{ce}->{0}->{ce0}->{obytes};
my $time1      = $Kstat->{ce}->{0}->{ce0}->{snaptime};

sleep(1);

$Kstat->update();

my $ce0rbytes2 = $Kstat->{ce}->{0}->{ce0}->{rbytes};
my $ce0obytes2 = $Kstat->{ce}->{0}->{ce0}->{obytes};
my $time2      = $Kstat->{ce}->{0}->{ce0}->{snaptime};

# This should be Rx Bytes per second and I don't care for
# the counter overflow ... (rrdtools will)
my $rrate = ($ce0rbytes2 - $ce0rbytes1)/($time2 - $time1);

Links:

Huebs
===
 
Similarly the undocumented netstat -k interface option gives useful numbers to collect data from (look for rbytes64, obytes64).

Annihilannic.
 
nsar, available from sunfreeware.com is supposed to show you some interesting statistics.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top