Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 May 2003 15:42:36 +0000
From:      Bosko Milekic <bmilekic@unixdaemons.com>
To:        "Michael R. Wayne" <wayne@staff.msen.com>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: mbuf reference?  (and missing man page)
Message-ID:  <200305231542.36266.bmilekic@unixdaemons.com>
In-Reply-To: <200305231907.h4NJ7ubu089890@manor.msen.com>
References:  <200305231907.h4NJ7ubu089890@manor.msen.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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)=20
  man page appearing in 5.x:

http://www.FreeBSD.org/cgi/man.cgi?apropos=3D0&sektion=3D9&; \
query=3Dmbuf&manpath=3DFreeBSD+5.0-current&format=3Dhtml

> 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=
=20
  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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to
> "freebsd-hackers-unsubscribe@freebsd.org"

--=20
Bosko Milekic
bmilekic@unixdaemons.com
bmilekic@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305231542.36266.bmilekic>