From owner-freebsd-current@FreeBSD.ORG Wed Jun 18 01:34:03 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F7B337B401 for ; Wed, 18 Jun 2003 01:34:03 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id E552243FBD for ; Wed, 18 Jun 2003 01:34:02 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h5I8Y1Ja074677; Wed, 18 Jun 2003 01:34:02 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h5I8Y1mn074676; Wed, 18 Jun 2003 01:34:01 -0700 (PDT) (envelope-from das@FreeBSD.ORG) Date: Wed, 18 Jun 2003 01:34:01 -0700 From: David Schultz To: Peter Losher Message-ID: <20030618083401.GA74409@HAL9000.homeunix.com> Mail-Followup-To: Peter Losher , current@freebsd.org References: <20030617080628.H1802@farside.isc.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030617080628.H1802@farside.isc.org> cc: current@FreeBSD.ORG Subject: Re: Problems tuning kmem_map on 5.1-REL box. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jun 2003 08:34:03 -0000 On Tue, Jun 17, 2003, Peter Losher wrote: > Hi - > > If this sort of question is better asked on a more specialized list > @freebsd.org, please let me know. (Since 5.1 is still considered a > developmental release, one doesn't know if either -current or -stable > would be more appropriate. So I am sending it to -current. > > So, I recently put a Quad-Xeon server (w/ 4GB of RAM) into production as > primarily as a master FTP server for ISC as well as for FreeBSD (US/IPv6 > side of ftp.freebsd.org). All has been going well for the past couple of > weeks until 5.1 was released. Traffic spiked, and the server started > panicking every 12 hours: > > > panic: kmem_malloc(4096): kmem_map too small: 377487360 total allocated > > So after looking at the archives, I read that FreeBSD had issues with > installed memory above 2GB, so I set the sysctl kern.maxvnodes=130000, but > to no effect: > > > panic: kmem_malloc(16384): kmem_map too small: 293519360 total allocated > > I have since removed my NMBCLUSTER setting in the kernel, so it would be > set automatically, I have even set VM_KMEM_SIZE_SCALE="2" (I haven't messed > with the other KMEM kernel options, as I was hoping to avoid it) And a > couple of hours ago I updated the kernel with the latest kern_malloc.c file > in the RELENG_5_1 branch. To allow the kmem_map to exceed 200 MB, you'll also need to tweak VM_KMEM_SIZE_MAX to (for example) '(1024 * 1024 * 1024)'. BTW, the formula, which I stole from vmparam.h, is: min(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), VM_KMEM_SIZE_MAX)