From owner-freebsd-performance@FreeBSD.ORG Wed Jan 5 11:51:59 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DFC7106564A for ; Wed, 5 Jan 2011 11:51:59 +0000 (UTC) (envelope-from gofp-freebsd-performance@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 533038FC08 for ; Wed, 5 Jan 2011 11:51:59 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PaRuI-0000JH-C3 for freebsd-performance@freebsd.org; Wed, 05 Jan 2011 12:51:58 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2011 12:51:58 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Jan 2011 12:51:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-performance@freebsd.org From: Ivan Voras Date: Wed, 05 Jan 2011 12:51:44 +0100 Lines: 20 Message-ID: References: <20101228135940.GE2660@baneblade.noc.nerim.net> <20101231090612.GN2660@baneblade.noc.nerim.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: <20101231090612.GN2660@baneblade.noc.nerim.net> X-Enigmail-Version: 1.1.2 Subject: Re: tunning disk cache for pgsql? 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: Wed, 05 Jan 2011 11:51:59 -0000 On 31/12/2010 10:06, Nicolas Haller wrote: > Someone knows if there is a page which explains FreeBSD mechanisms about > memory and fs cache management? I think I must read something on it :-) I don't think there's a single up to date document describing all of it, but it's conceptually simple and similar to what other OSes do. It's just that "top" output is somewhat verbose and low-level. You can start here: http://www.freebsd.org/doc/en/books/arch-handbook/vm.html (it's a bit outdated). Basically, to support both mmap() and read() / write(), the OS thinks of everything in terms of memory pages. When an application reads or writes something from / to a file, it's a "page-in" or "page-out" of a sort, and the page gets put in the active list. After some time it spends unused by the process, it's moved to the inactive list, then to the cache list. These separate lists exist AFAIK mostly to speed up searching.