X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id A9F65B439C9 for ; Thu, 10 Jul 2003 00:25:38 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 31130-09 for ; Wed, 9 Jul 2003 21:25:06 -0300 (ADT) Received: from ethereal-realms.org (thebe.ethereal-realms.org [142.179.222.205]) by svr1.postgresql.org (Postfix) with ESMTP id 3F503B430C3 for ; Wed, 9 Jul 2003 21:25:06 -0300 (ADT) Received: from ethereal-realms.org (ip14.ethereal-realms.COM [192.168.1.14]) by ethereal-realms.org (8.12.6/8.12.6) with ESMTP id h6A0NlUc025125; Wed, 9 Jul 2003 18:23:48 -0600 (MDT) Message-ID: <3F0CB210.60309@ethereal-realms.org> Date: Wed, 09 Jul 2003 18:23:44 -0600 From: Martin Foster Organization: Ethereal Realms User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sean Chittenden , PostgreSQL Performance Subject: Re: Moving postgresql.conf tunables into 2003... References: <20030703190502.GR72567@perrin.int.nxad.com> <20030709233031.GF72567@perrin.int.nxad.com> In-Reply-To: <20030709233031.GF72567@perrin.int.nxad.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/159 X-Sequence-Number: 2452 Sean Chittenden wrote: > > I looked through the src/doc/runtime.sgml for a good place to stick > this and couldn't find a place that this seemed appropriate, but on > FreeBSD, this can be determined with a great deal of precision in a > programmatic manner: > > echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" > > The same OID is available via C too. It'd be slick if PostgreSQL > could tune itself (on FreeBSD) at initdb time with the above code. If > Linux exports this info via /proc and can whip out the appropriate > magic, even better. An uncommented out good guess that shows up in > postgresql.conf would be stellar and quite possible with the use of > sed. > > Maybe an initdb switch could be added to have initdb tune the config > it generates? If a -n is added, have it generate a config and toss it > to stdout? > > > case `uname` in > "FreeBSD") > echo "effective_cache_size = $((`sysctl -n vfs.hibufspace` / 8192))" > ;; > *) > echo "Unable to automatically determine the effective cache size" >> /dev/stderr > ;; > esac > > > -sc > Simplest way may be to create a 'auto-tune' directory with scripts for configured platforms. When postgres installs the databases, it checks for 'tune.xxx' and if found uses that to generate the script itself? This would allow for defaults on platforms that do not have them and optimization for those that do. Martin Foster Creator/Designer Ethereal Realms martin@ethereal-realms.org