netstat -m command to monitor mbuf pools
Use the netstat -m command to detect shortages or failures of network memory (mbufs/clusters) requests.
You can use the netstat -Zm command to clear
(or zero) the mbuf statistics. This is helpful when running tests to start
with a clean set of statistics. The following fields are provided with the netstat -m command:
- Field name
- Definition
- By size
- Shows the size of the buffer.
- inuse
- Shows the number of buffers of that particular size in use.
- calls
- Shows the number of calls, or allocation requests, for each sized buffer.
- failed
- Shows how many allocation requests failed because no buffers were available.
- delayed
- Shows how many calls were delayed if that size of buffer was empty and theM_WAIT flag was set by the caller.
- free
- Shows the number of each size buffer that is on the free list, ready to be allocated.
- hiwat
- Shows the maximum number of buffers, determined by the system, that can remain on the free list. Any free buffers above this limit are slowly freed back to the system.
- freed
- Shows the number of buffers that were freed back to the system when the free count when above the hiwat limit.
You should not see a large number of failed calls. There might be a few, which trigger the system to allocate more buffers as the buffer pool size increases. There is a predefined set of buffers of each size that the system starts with after each reboot, and the number of buffers increases as necessary.
The following is an example of the netstat -m command
from a two-processor or CPU machine:
# netstat -m
Kernel malloc statistics:
******* CPU 0 *******
By size inuse calls failed delayed free hiwat freed
32 68 693 0 0 60 2320 0
64 55 115 0 0 9 1160 0
128 21 451 0 0 11 580 0
256 1064 5331 0 0 1384 1392 42
512 41 136 0 0 7 145 0
1024 10 231 0 0 6 362 0
2048 2049 4097 0 0 361 362 844
4096 2 8 0 0 435 435 453
8192 2 4 0 0 0 36 0
16384 0 513 0 0 86 87 470
******* CPU 1 *******
By size inuse calls failed delayed free hiwat freed
32 139 710 0 0 117 2320 0
64 53 125 0 0 11 1160 0
128 41 946 0 0 23 580 0
256 62 7703 0 0 1378 1392 120
512 37 109 0 0 11 145 0
1024 21 217 0 0 3 362 0
2048 2 2052 0 0 362 362 843
4096 7 10 0 0 434 435 449
8192 0 4 0 0 1 36 0
16384 0 5023 0 0 87 87 2667
***** Allocations greater than 16384 Bytes *****
By size inuse calls failed delayed free hiwat freed
65536 2 2 0 0 0 4096 0
Streams mblk statistic failures:
0 high priority mblk failures
0 medium priority mblk failures
0 low priority mblk failures