Date: Wed, 20 Mar 2002 17:43:29 +0100 From: Francesco Casadei <fcasadei@inwind.it> To: Dmitry Mottl <dima@sinp.msu.ru> Cc: freebsd-questions@FreeBSD.org Subject: Re: mbufs, nmbclusters Message-ID: <20020320174329.E2375@goku.kasby> In-Reply-To: <Pine.BSF.4.43.0203181801540.59799-100000@BigKing.sinp.msu.ru>; from dima@sinp.msu.ru on Mon, Mar 18, 2002 at 06:14:23PM %2B0300 References: <Pine.BSF.4.43.0203181801540.59799-100000@BigKing.sinp.msu.ru>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Mon, Mar 18, 2002 at 06:14:23PM +0300, Dmitry Mottl wrote:
> Hi
>
> How can I find which program uses a lot of kernel mbufs and nmbclusters?
> Is the maximum number of nmbclusters that can be occupied by program is
> N*(net.inet.tcp.sendspace+net.inet.tcp.recvspace)/2048, where N is number
> of tcp connections opened by the program?
>
> Thank you
>
> Best regards,
> Dmitry Mottl
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
> end of the original message
From tuning(7) manual page:
[...]
kern.ipc.nmbclusters may be adjusted to increase the number of network
mbufs the system is willing to allocate. Each cluster represents approx
imately 2K of memory, so a value of 1024 represents 2M of kernel memory
reserved for network buffers. You can do a simple calculation to figure
out how many you need. If you have a web server which maxes out at 1000
simultaneous connections, and each connection eats a 16K receive and 16K
send buffer, you need approximate 32MB worth of network buffers to deal
with it. A good rule of thumb is to multiply by 2, so 32MBx2 = 64MB/2K =
32768. So for this case you would want to set kern.ipc.nmbclusters to
32768. We recommend values between 1024 and 4096 for machines with mod
erates amount of memory, and between 4096 and 32768 for machines with
greater amounts of memory. Under no circumstances should you specify an
arbitrarily high value for this parameter, it could lead to a boot-time
crash. The -m option to netstat(1) may be used to observe network clus
ter use. Older versions of FreeBSD do not have this tunable and require
that the kernel config(8) option NMBCLUSTERS be set instead.
[...]
So I would say yes the number of nmbclusters is:
N*(net.inet.tcp.sendspace+net.inet.tcp.recvspace)/2048
Francesco Casadei
--
You can download my public key from http://digilander.iol.it/fcasadei/
or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...)
Key fingerprint is: 1671 9A23 ACB4 520A E7EE 00B0 7EC3 375F 164E B17B
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org
iD8DBQE8mLwxfsM3XxZOsXsRAjyVAKCzBGAc9IoumepA1MH7jj4RnLkSAgCdHL4E
xtLn6j/TP2dnFG2DYZruBXw=
=VpW0
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020320174329.E2375>
