This command uses the trace facility to obtain a detailed picture of network activity during a time interval.
netpmon -o /tmp/netpmon.log; sleep 20; trcstopis used to look for a number of things such as CPU usage by program, first level interrupt handler, network device driver statistics, and network statistics by program. Add the -t flag to produce thread level reports. The following output shows the processor view from netpmon.
Process CPU Usage Statistics: ----------------------------- Network Process (top 20) PID CPU Time CPU % CPU % ---------------------------------------------------------- java 12192 2.0277 5.061 1.370 UNKNOWN 13758 0.8588 2.144 0.000 gil 1806 0.0699 0.174 0.174 UNKNOWN 18136 0.0635 0.159 0.000 dtgreet 3678 0.0376 0.094 0.000 swapper 0 0.0138 0.034 0.000 trcstop 18460 0.0121 0.030 0.000 sleep 18458 0.0061 0.015 0.000The adapter usage is shown here:
----------- Xmit ----------- -------- Recv --------- Device Pkts/s Bytes/s Util QLen Pkts/s Bytes/s Demux ------------------------------------------------------------------------------ token ring 0 288.95 22678 0.0%518.498 552.84 36761 0.0222 ... DEVICE: token ring 0 recv packets: 11074 recv sizes (bytes): avg 66.5 min 52 max 1514 sdev 15.1 recv times (msec): avg 0.008 min 0.005 max 0.029 sdev 0.001 demux times (msec): avg 0.040 min 0.009 max 0.650 sdev 0.028 xmit packets: 5788 xmit sizes (bytes): avg 78.5 min 62 max 1514 sdev 32.0 xmit times (msec): avg 1794.434 min 0.083 max 6443.266 sdev 2013.966The following example shows the java extract:
PROCESS: java PID: 12192 reads: 2700 read sizes (bytes): avg 8192.0 min 8192 max 8192 sdev 0.0 read times (msec): avg 184.061 min 12.430 max 2137.371 sdev 259.156 writes: 3000 write sizes (bytes): avg 21.3 min 5 max 56 sdev 17.6 write times (msec): avg 0.081 min 0.054 max 11.426 sdev 0.211To see a thread level report, add the -t as shown here.
netpmon -O so -t -o /tmp/netpmon_so_thread.txt; sleep 20; trcstopThe following extract shows the thread output:
THREAD TID: 114559 reads: 9 read sizes (bytes): avg 8192.0 min 8192 max 8192 sdev 0.0 read times (msec): avg 988.850 min 19.082 max 2106.933 sdev 810.518 writes: 10 write sizes (bytes): avg 21.3 min 5 max 56 sdev 17.6 write times (msec): avg 0.389 min 0.059 max 3.321 sdev 0.977You can also request that less information is gathered. For example to look at socket level traffic use the "-O so" option:
netpmon -O so -o /tmp/netpmon_so.txt; sleep 20; trcstop