Date: Wed, 05 Mar 2003 15:40:50 -0600 From: Kirk Strauser <kirk@strauser.com> To: freebsd-questions@freebsd.org Subject: How many mbufs do I need? Message-ID: <87bs0ppk4d.fsf@strauser.com>
next in thread | raw e-mail | index | archive | help
--=-=-= Content-Transfer-Encoding: quoted-printable I killed my FreeBSD 4.8-PRE (2003-02-18) server today by exhausting the available mbufs. I'd seen warnings like "All mbuf clusters exhausted, please see tuning(7)." in /var/log/messages, so I added `kern.ipc.nmbclusters=3D"16384"' to /boot/loader.conf.local a while back. This server has 768MB of memory, and I run at least two copies of PostgreSQL (it has multiple jails) at any given time and use it to server NFS to a couple of Linux clients. Today I wanted to test Bochs on one of the Linux machines, ran the bochsconf program, watched it run "createdisk" to make a 512MB disk image in my home directory, and saw the server panic within a few seconds. When it came back up, I bumped nmbclusters to 32768, rebooted, and tried createdisk it. This time I watched `netstat -m' as the dreaded "All mbuf clusters exhausted..." message began to scroll up the screen. This time, the server stayed alive, but it clearly maxed out all available buffers. After createdisk was finished, the mbuf usage went back to normal: $ netstat -m 389/36736/131072 mbufs in use (current/peak/max): 389 mbufs allocated to data 388/32768/32768 mbuf clusters in use (current/peak/max) 74720 Kbytes allocated to network (33% of mb_map in use) 345 requests for memory denied 1 requests for memory delayed 0 calls to protocol drain routines My questions are these: 1) Is there a guideline for how many nmbclusters to allocate? Short of running out of physical memory, is there such a thing as too many? 2) I've already allocated 64MB to network buffering. This seems like a huge amount to me. Is it? 3) Should running out of mbufs be expected to crash the server, or should I try to reproduce it and file a PR? 4) What could createdisk have been doing to spike usage that heavily? 5) Could Linux's NFS client implementation have aggravated the situation? =2D-=20 Kirk Strauser In Googlis non est, ergo non est. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA+Zm7o5sRg+Y0CpvERAqYRAKCC4SmGHO+K+Rjs/FiE72L/TabTkQCgjGiX EexNKSAvFm9XRFRo5Q6nnWc= =v23R -----END PGP SIGNATURE----- --=-=-=-- 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?87bs0ppk4d.fsf>