From owner-freebsd-performance@FreeBSD.ORG Sat Jul 29 23:43:25 2006 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C748916A4E0 for ; Sat, 29 Jul 2006 23:43:25 +0000 (UTC) (envelope-from jin@george.lbl.gov) Received: from smtp109.sbc.mail.mud.yahoo.com (smtp109.sbc.mail.mud.yahoo.com [68.142.198.208]) by mx1.FreeBSD.org (Postfix) with SMTP id 6606043D6B for ; Sat, 29 Jul 2006 23:43:25 +0000 (GMT) (envelope-from jin@george.lbl.gov) Received: (qmail 78561 invoked from network); 29 Jul 2006 23:43:24 -0000 Received: from unknown (HELO ?192.168.2.9?) (jinmtb@sbcglobal.net@68.127.173.50 with plain) by smtp109.sbc.mail.mud.yahoo.com with SMTP; 29 Jul 2006 23:43:24 -0000 Message-ID: <44CBF2E8.5060504@george.lbl.gov> Date: Sat, 29 Jul 2006 16:44:40 -0700 From: "Jin Guojun [VFFS]" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050108 X-Accept-Language: en, zh, zh-CN MIME-Version: 1.0 To: Raymond Owens References: <003801c6b2a2$5b6687d0$0501a8c0@desky64> In-Reply-To: <003801c6b2a2$5b6687d0$0501a8c0@desky64> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-performance@freebsd.org Subject: Re: question concerning proper usage of kernel variables net.bpf.bufsize and vm_kmem_size_max X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jul 2006 23:43:25 -0000 Raymond Owens wrote: >Sir, > >By hardware cache size, you are referring to the processor cache? If the box has two processors, should the value used for cache size in this calculation be doubled? In very general terms, what is the link between the net.bpf.bufsize and the cache? Thanks for info.. > > > BPF was designed to use ping-pong buffers, which create a link to the cache. It is not hard to see an individual bpf buffer size should not close to the cache size if upper layer applications need to continue to capture packets. If up layer program cannot drain the BPF buffer faster than the NIC to fill the buffer, increasing buffer only gives you a short-time cushion at start phase. Once buffers are filled, you will start to lose packets anyway. Only situation to increasing BPF size above cache size is if applications are designed for catching periodically bursting traffic, and the CPU/system is slow enough and not able to compete with NIC I/O. Under such scenario, you could to increase the BPF buffer size to cushion the surge. > R. B. Riddick wrote: > > >--- Raymond Owens wrote: > > > > > >>Questions: > >>Can VM_KMEM_SIZE_MAX be set manually with sysctl? > >> > >> > >> > >No, but you could set it with this procedure: > >1. Insert the lines > > vm.kmem_size=123456789 > > vm.kmem_size_max=1234567890 > >in > > /boot/loader.conf > > > >2. reboot > > > >That should change those values... > >(see src/sys/kern/kern_malloc.c) > > > >I wonder, why your box needs such a big buffer? Do u have network traffic > >bursts or so? > > > > > Regardless what purpose is for, the net.bpf.bufsize should never > set above hardware cache size. The best (optimal size) is 50% - 80% > of the hardware cache size, unless original BPF is modified in some > way I do not know. > Such high bufsize will degrade performance. > >