From owner-freebsd-net@FreeBSD.ORG Fri Aug 1 14:22:07 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8935B37B401 for ; Fri, 1 Aug 2003 14:22:07 -0700 (PDT) Received: from csmail.commserv.ucsb.edu (cspdc.commserv.ucsb.edu [128.111.251.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66DD243F75 for ; Fri, 1 Aug 2003 14:22:06 -0700 (PDT) (envelope-from steve@expertcity.com) Received: from expertcity.com ([68.111.37.3]) by csmail.commserv.ucsb.edu (Netscape Messaging Server 3.62) with ESMTP id 597; Fri, 1 Aug 2003 14:22:04 -0700 Message-ID: <3F2ADA02.7050304@expertcity.com> Date: Fri, 01 Aug 2003 14:22:10 -0700 From: Steve Francis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030612 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mike Silbersack References: <3F2AC3F5.3010804@expertcity.com> <20030801152510.J2165@odysseus.silby.com> In-Reply-To: <20030801152510.J2165@odysseus.silby.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: mbuf clusters exhausted w/o reaching max? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 21:22:07 -0000 THanks for the reply... Question below. Mike Silbersack wrote: >Mbufs & mbuf clusters are allocated from the kernel map, so it's possible >for allocations to fail due to the kernel map being relatively full due to >other parts of the kernel eating memory. This is probably what's >happening in your case; given that only 50 allocations were denied, it >probably didn't hurt your system much. > >Note that the kernel map is not the size of all ram; it's usually only 1/4 >of the amount of ram available, with a ceiling of 256MB. You could try >playing with those parameters, but you'll probably end up causing other >problems in the process. :) > From LINT (see below), the comment says the VM_KMEM_SIZE_MAX is 200M, yet the option says 100M. Comment typo, or typo in the option? Is increasing the VM_KMEM_SIZE_MAX (which should take us to up to 256M given 1G RAM) sufficient to allow extra space for mbuf clusters? I googled and found this from das@freebsd.org on a related question: "Within the kernel's share of this address space, memory is split into submaps, such as the mb_map (for the network), buffer_map for the filesystem buffer cache, and the kmem_map for just about everything else. These submaps are size-limited to prevent any one of them from getting out of hand." I presume I need to increase mb_map, but could not find a specific option for that. Does that scale with an increased VM_KMEM_SIZE_MAX? These servers basically run one process, which is about 500M resident and total size, on 1G RAM machine, and do tons of network IO with lots of packets. Given that, do you still anticipate " causing other problems in the process" if I tune this? Thanks # Tune the kernel malloc area parameters. VM_KMEM_SIZE represents the # minimum, in bytes, and is typically (12*1024*1024) (12MB). # VM_KMEM_SIZE_MAX represents the maximum, typically 200 megabytes. # VM_KMEM_SIZE_SCALE can be set to adjust the auto-tuning factor, which # typically defaults to 4 (kernel malloc area size is physical memory # divided by the scale factor). # options VM_KMEM_SIZE="(10*1024*1024)" options VM_KMEM_SIZE_MAX="(100*1024*1024)" options VM_KMEM_SIZE_SCALE="4"