X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2FC72D1B532 for ; Mon, 13 Oct 2003 19:05:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15626-06 for ; Mon, 13 Oct 2003 16:04:47 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 63B27D1B515 for ; Mon, 13 Oct 2003 16:04:48 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id C98032106E; Mon, 13 Oct 2003 12:04:46 -0700 (PDT) Date: Mon, 13 Oct 2003 12:04:46 -0700 From: Sean Chittenden To: Vivek Khera Cc: pgsql-performance@postgresql.org Subject: Re: go for a script! / ex: PostgreSQL vs. MySQL Message-ID: <20031013190446.GA72842@perrin.nxad.com> References: <007901c38f2b$0b585590$2802a8c0@webbased10> <200310101034.52073.josh@agliodbs.com> <3F86F5BB.90605@chuckie.co.uk> <3F87932B.4050507@familyhealth.com.au> <20031011092308.GA39942@perrin.nxad.com> <16266.45299.517752.465494@yertle.int.kciLink.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16266.45299.517752.465494@yertle.int.kciLink.com> X-PGP-Key: finger seanc@FreeBSD.org X-PGP-Fingerprint: 3849 3760 1AFE 7B17 11A0 83A6 DD99 E31F BC84 B341 X-Web-Homepage: http://sean.chittenden.org/ User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/427 X-Sequence-Number: 4175 > >> echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" > >> > >> I've used it for my dedicated servers. Is this calculation correct? > > SC> Yes, or it's real close at least. vfs.hibufspace is the amount > of SC> kernel space that's used for caching IO operations (minus the > > I'm just curious if anyone has a tip to increase the amount of > memory FreeBSD will use for the cache? Recompile your kernel with BKVASIZE set to 4 times its current value and double your nbuf size. According to Bruce Evans: "Actually there is a way: the vfs_maxbufspace gives the amount of space reserved for buffer kva (= nbuf * BKVASIZE). nbuf is easy to recover from this, and the buffer kva space may be what is wanted anyway." [snip] "I've never found setting nbuf useful, however. I want most parametrized sizes including nbuf to scale with resource sizes, and it's only with RAM sizes of similar sizes to the total virtual address size that its hard to get things to fit. I haven't hit this problem myself since my largest machine has only 1GB. I use an nbuf of something like twice the default one, and a BKVASIZE of 4 times the default. vfs.maxbufspace ends up at 445MB on the machine with 1GB, so it is maxed out now." YMMV. -sc -- Sean Chittenden