X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 2E014D1B50E for ; Sat, 11 Oct 2003 09:23:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 23902-06 for ; Sat, 11 Oct 2003 06:23:13 -0300 (ADT) Received: from perrin.nxad.com (internal.nxad.com [69.1.70.251]) by svr1.postgresql.org (Postfix) with ESMTP id 29A3BD1B4FC for ; Sat, 11 Oct 2003 06:23:07 -0300 (ADT) Received: by perrin.nxad.com (Postfix, from userid 1001) id 978FD21066; Sat, 11 Oct 2003 02:23:08 -0700 (PDT) Date: Sat, 11 Oct 2003 02:23:08 -0700 From: Sean Chittenden To: Christopher Kings-Lynne Cc: Vivek Khera , pgsql-performance@postgresql.org Subject: Re: go for a script! / ex: PostgreSQL vs. MySQL Message-ID: <20031011092308.GA39942@perrin.nxad.com> References: <007901c38f2b$0b585590$2802a8c0@webbased10> <200310101034.52073.josh@agliodbs.com> <3F86F5BB.90605@chuckie.co.uk> <3F87932B.4050507@familyhealth.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F87932B.4050507@familyhealth.com.au> 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/382 X-Sequence-Number: 4130 > >NB> shared_buffers = 1/16th of total memory > >NB> effective_cache_size = 80% of the supposed kernel cache. > > I think Sean(?) mentioned this one for FreeBSD (Bash code): sh, not bash. :) > echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" > > I've used it for my dedicated servers. Is this calculation correct? Yes, or it's real close at least. vfs.hibufspace is the amount of kernel space that's used for caching IO operations (minus the necessary space taken for the kernel). If you're real paranoid, you could do some kernel profiling and figure out how much of the cache is actually disk IO and multiply the above by some percentage, say 80%? I haven't found it necessary to do so yet. Since hibufspace is all IO and caching any net activity is kinda pointless and I assume that 100% of it is used for a disk cache and don't use a multiplier. The 8192, however, is the size of a PG page, so, if you tweak PG's page size, you have to change this constant (*grumbles*). -sc -- Sean Chittenden