From owner-freebsd-questions Wed Jul 24 12:40:54 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 150CB37B400 for ; Wed, 24 Jul 2002 12:40:50 -0700 (PDT) Received: from hebe.or.intel.com (jffdns02.or.intel.com [134.134.248.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 75D3C43E7B for ; Wed, 24 Jul 2002 12:40:49 -0700 (PDT) (envelope-from pavan.balaji@intel.com) Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by hebe.or.intel.com (8.11.6/8.11.6/d: solo.mc,v 1.42 2002/05/23 22:21:11 root Exp $) with SMTP id g6OJenf07724 for ; Wed, 24 Jul 2002 19:40:49 GMT Received: from orsmsx26.jf.intel.com ([192.168.65.26]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2002072412413314338 ; Wed, 24 Jul 2002 12:41:33 -0700 Received: by orsmsx26.jf.intel.com with Internet Mail Service (5.5.2653.19) id ; Wed, 24 Jul 2002 12:40:47 -0700 Message-ID: <3D386AED1B47D411A94300508B11F18703BC5C27@fmsmsx116.fm.intel.com> From: "Balaji, Pavan" To: "'Jeff Jirsa'" , "Balaji, Pavan" Cc: "'James Snow'" , ntai@mac.com, freebsd-questions@FreeBSD.ORG Subject: RE: Number of mbuf clusters (NMBCLUSTERS) Date: Wed, 24 Jul 2002 12:40:43 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Oops. Sorry. I didn't know that we had an option to do this in the conf file. I couldn't find it there though. Pavan Balaji, Intel Corporation "Only the Paranoid Survive" -- Andy Grove > -----Original Message----- > From: Jeff Jirsa [mailto:jeff@boris.st.hmc.edu] > Sent: Wednesday, July 24, 2002 2:32 PM > To: Balaji, Pavan > Cc: 'James Snow'; ntai@mac.com; freebsd-questions@FreeBSD.ORG > Subject: RE: Number of mbuf clusters (NMBCLUSTERS) > > > On Wed, 24 Jul 2002, Balaji, Pavan wrote: > > > > > You can increase the maximum number of clusters in > /usr/src/sys/sys/sysctl.h > > and recompile the kernel. But make sure that you have a > stable kernel image > > ready, just in case you increase this value so much that > your kernel doesn't > > boot ;) > > > > I guess the default value is around 9, while for 256MB mem, > you can go upto > > maybe 10000 clusters. > > That's questionable advice. Reading the tuning(7) man page: > > > NMBCLUSTERS may be adjusted to increase the number of > network mbufs the > system is willing to allocate. Each cluster represents > approximately 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 se NMBCLUSTERS to 32768. > We recommend > values between 1024 and 4096 for machines with moderates > amount of mem- > ory, and between 4096 and 32768 for machines with greater > amounts of mem- > ory. 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 cluster use. > > Figure out how many connections you'll deal with, and then > increase the > value accordingly, rather than simply guessing and possibly wasting > memory you may want to use elsewhere. I'd also recommend > modifying your > kernel config file rather than sysctl.h, and then rebuilding. > > - Jeff > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message