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>
next in thread | previous in thread | raw e-mail | index | archive | help
--3O1VwFp74L81IIeR Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 18, 2002 at 06:14:23PM +0300, Dmitry Mottl wrote: > Hi >=20 > 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? >=20 > Thank you >=20 > Best regards, > Dmitry Mottl >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message >=20 > end of the original message =46rom 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 appr= ox=AD 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 figu= re out how many you need. If you have a web server which maxes out at 10= 00 simultaneous connections, and each connection eats a 16K receive and 1= 6K 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 =3D 64MB= /2K =3D 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 mo= d=AD 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 clu= s=AD ter use. Older versions of FreeBSD do not have this tunable and requi= re 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 --=20 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 --3O1VwFp74L81IIeR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE8mLwxfsM3XxZOsXsRAjyVAKCzBGAc9IoumepA1MH7jj4RnLkSAgCdHL4E xtLn6j/TP2dnFG2DYZruBXw= =VpW0 -----END PGP SIGNATURE----- --3O1VwFp74L81IIeR-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020320174329.E2375>