From owner-freebsd-performance@FreeBSD.ORG Sun Apr 18 23:37:56 2004 Return-Path: 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 BE7F216A4CF for ; Sun, 18 Apr 2004 23:37:56 -0700 (PDT) Received: from gen129.n001.c02.escapebox.net (gen129.n001.c02.escapebox.net [213.73.91.129]) by mx1.FreeBSD.org (Postfix) with ESMTP id 447AC43D48 for ; Sun, 18 Apr 2004 23:37:56 -0700 (PDT) (envelope-from gemini@geminix.org) Message-ID: <408373C0.7080502@geminix.org> Date: Mon, 19 Apr 2004 08:37:52 +0200 From: Uwe Doering Organization: Private UNIX Site User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040119 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-performance@freebsd.org References: <20040416163845.GG87362@nasby.net> <20040416221211.GM87362@nasby.net> <4080DF9F.3040302@geminix.org> <20040419022043.GO87362@nasby.net> In-Reply-To: <20040419022043.GO87362@nasby.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Received: from gemini by geminix.org with asmtp (TLSv1:AES256-SHA:256) (Exim 3.36 #1) id 1BFSPi-000B9b-00; Mon, 19 Apr 2004 08:37:54 +0200 Subject: Re: How does disk caching work? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 06:37:56 -0000 Jim C. Nasby wrote: > On Sat, Apr 17, 2004 at 09:41:19AM +0200, Uwe Doering wrote: > [...] > A few questions if I may... > > What's a good way to tune amount of space dedicated to IO buffers? You can tune the number of i/o buffers, and therefore indirectly the amount of memory they may allocate, by using the variable 'kern.nbuf' in '/boot/loader.conf'. Note that this number gets multiplied by 16384 (the default filesystem block size) to arrive at the amount of memory it results in. My experience is that with large amounts of RAM this area becomes unduely big, though. It's not that you have to skimp on RAM in this enviroment, but the disk i/o buffers eat away at the KVM region (kernel virtual memory), which happens to be just 1 GB by default and doesn't grow with the RAM size. So it can be a good idea to actually reduce the number of disk i/o buffers (compared to its auto-scaled default) on systems with plenty of RAM (since you don't need that many buffers, anyway, due to the VM interaction I just described) and save the available KVM rather for other purposes (kernel resources). Systems that run out of KVM are prone to kernel panics, given the right combination of circumstances. > What impact will vm_min|max_cache have on system performance? Is there > any advantage to setting it fairly high? I'm not quite sure which variables you are referring to. In FreeBSD there are 'vm.v_cache_min' and 'vm.v_cache_max'. I don't recommend tuning them, though, without having a very deep and thorough look at the kernel sources. Many of these variables don't really do what their name suggests, and there are interdependencies between some of them. You can lock up your server by tuning them improperly. > The machine I'm tuning is a dual Opteron box with 4G of ram, a mirror > and a 6 disk RAID10. It's running PostgreSQL. I'm not a PostgreSQL expert, but there have been discussions on this mailing list and elsewhere about tuning PostgreSQL. I suggest to take a look at the archives. Uwe -- Uwe Doering | EscapeBox - Managed On-Demand UNIX Servers gemini@geminix.org | http://www.escapebox.net