mbuf reference? (and missing man page)
Bosko Milekic
bmilekic at unixdaemons.com
Fri May 23 12:41:57 PDT 2003
On May 23, 2003 07:07 pm, Michael R. Wayne wrote:
> Missing man page:
> 4.8 releasse - man netstat has a reference to mbuf(9) but man mbuf
> says: No manual entry for mbuf
True. This is a bug. Someone from -doc should fix this, because
mbuf(9) only exists in 5.0 and later. Try submitting a PR and
filing it to -doc. Here's a link to an on-line version of the mbuf(9)
man page appearing in 5.x:
http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=9& \
query=mbuf&manpath=FreeBSD+5.0-current&format=html
> Real question:
> I'm seeking some additional documentation on the relationship
> between mbufs, mbuf clusters and network memory usage (essentially
> the output of netstat -m).
>
> Obviously, the number of mbuf clusters is tunable with
> kern.ipc.nmbclusters. The maximum number of mbufs appears to be 4 *
> that number (or is that 4 a tunable?)
kern.ipc.nmbclusters and kern.ipc.nmbufs set the number of clusters and
the number of mbufs, respectively, and are tunable at boottime.
> Not sure how network memory allocation is chosen (% of base memory
> size as default?) and, does it grow dynamically or should one be
> building a new kernel once, say, 80% of the mb_map is in use? Or
> simply ignore occasional high mb_map utilization unless requests
> for memorey are delayed/denied?
Yeah, the last thing you said sounds correct. You don't want to be
tuning for high memory usage just because you had a single spike.
This is one of the advantages of having a capped virtual address
space for network buffers (that does not grow dynamically);
if you get hit by a sudden high usage
spike (e.g., DOS, other irregularity), your system will hopefully stay
alive as the network buffer usage will get capped off due to the
finiteness of the address space reserved for the buffers.
So, basically, you want to tune/increase NMBCLUSTERS
according to how many times you've failed on the allocations over
a longer period of time. If you are always hitting high usage and
failing, you should consider increasing NMBCLUSTERS. If you
notice that your highest cluster or mbuf usage has never actually
hit the maximum, but you're still getting memory denied requests,
then you're actually running out of RAM, and increasing
NMBCLUSTERS is not going to help you. Adding RAM is.
> /\/\ \/\/
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to
> "freebsd-hackers-unsubscribe at freebsd.org"
--
Bosko Milekic
bmilekic at unixdaemons.com
bmilekic at FreeBSD.org
More information about the freebsd-hackers
mailing list