What's the exact meaning of Send Buffer byte count in the extended netstat statistics, and why is it always bigger than Send-Q?
In other words, what's counted against the S-BCNT that's not counted against the Send-Q?
Is S-BCNT a better number to use to figure the cost to the system of a particular connection?
You can find definition along with comments at
sys/sys/sockbuf.h
:BSDs are using structures called
mbuf
/mbuf_cluster
for network data. They used everywhere from driver code to socket layer. Even if packet had 1 byte of payload it will consume 256 (mbuf
) bytes in mbuf. If packet size (with all frame/packet headers) >= 256 it will consume 256 (mbuf
) + 2048 (mbuf_cluster
) bytes. Hence the difference betweensb_cc
andsb_mbcnt
.To answer your question:
S-BCNT
is more correct value to use.PS. For more information consult to TCP/IP Illustrated Volume 2 - W. Richard Stevens and Garry R. Wright, Chapter 16 - Socket I/O, Section 16.3 - Socket Buffers, p.476