Java Reference
In-Depth Information
or the total amount of data written to a particular network interface might be more than the
interface is able to handle.
Unfortunately, standard system tools are less than ideal for monitoring network traffic be-
cause they typically show only the number of packets and number of bytes that are sent and
received over a particular network interface. That is useful information, but it doesn't tell us
if the network is under- or overutilized.
On Unix systems, the basic network monitoring tool is netstat (and on most Linux distribu-
tions, netstat is not even included and must be obtained separately). On Windows,
typeperf can be used in scripts to monitor the network usageā€”but here is a case where the
GUI has an advantage: the standard Windows resource monitor will display a graph showing
what percentage of the network is in use. Unfortunately, the GUI is of little help in an auto-
mated performance testing scenario.
Fortunately, there are many open source and commercial tools that monitor network band-
width. On Unix systems, one popular command-line tool is nicstat , which presents a sum-
mary of the traffic on each interface, including the degree to which the interface is utilized:
% nicstat 5
Time Int rKB/s wKB/s rPk/s wPk/s rAvs wAvs %Util Sat
17:05:17 e1000g1 225.7 176.2 905.0 922.5 255.4 195.6 0.33 0.00
The e1000g1 interface is a 1,000 MB interface; it is not utilized very much (0.33%) in this
example. The usefulness of this tool (and others like it) is that it calculates the utilization of
the interface. In this output, there are 225.7 Kbps of data being written and 176.2 Kbps of
data being read over the interface. Doing the division for a 1,000 MB network yields the
0.33% utilization figure, and the nicstat tool was able to figure out the bandwidth of the in-
terface automatically.
Tools such as typeperf or netstat will report the amount of data read and written, but to
figure out the network utilization, you must determine the bandwidth of the interface and
perform the calculation in your own scripts. Be sure to remember that the bandwidth is meas-
ured in bits per second (bps), although tools generally report bytes per second (Bps). A
1,000-megabit network yields 125 megabytes (MB) per second. In this example, 0.22 MBps
are read and 0.16 MBps are written; adding those and dividing by 125 yields a 0.33% utiliza-
tion rate. So there is no magic to nicstat (or similar) tools; they are just more convenient to
use.
Search WWH ::




Custom Search