MBUF statistics
Don Lewis
truckman at FreeBSD.org
Wed Feb 16 02:23:00 PST 2005
On 15 Feb, Max Laier wrote:
> On Tuesday 15 February 2005 12:38, Borja Marcos wrote:
>> Hello,
>>
>> Looking at the mbuf statistics available in FreeBSD 4 and FreeBSD 5 I
>> can see that the statistics available in FreeBSD 5 are, surprisingly,
>> much less comprehensive. Is there any other place where I can find out
>> how many mbuf requests have been done, how many of them have waited,
>> how many have failed, etc?
>
> I use "$vmstat -z | grep Mbuf". The netstat -m output is broken, because
> fixing this would impose an additional atomic operation on each alloc/free
> which is a real performance killer.
Why not maintain the statistics on a per-CPU basis, and sum up the
per-CPU statistics in the sysctl handler? The handler might not get an
exact snapshot, but that shouldn't matter.
In the case of counters that are wider than 32 bits, it might be
necessary to break the counters up into chunks that can be incremented
atomically, and grab a lock when the least significant chunk overflows.
More information about the freebsd-hackers
mailing list