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 B8A8CD1B4FC for ; Fri, 3 Oct 2003 18:11:17 +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 03129-08 for ; Fri, 3 Oct 2003 15:10:29 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 5B6B2D1B4E3 for ; Fri, 3 Oct 2003 15:10:27 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3718705; Fri, 03 Oct 2003 11:10:37 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Stef , pgsql-performance@postgresql.org Subject: Re: Postgres low end processing. Date: Fri, 3 Oct 2003 11:08:48 -0700 User-Agent: KMail/1.4.3 References: <20031003163040.3641f39a.svb@ucs.co.za> In-Reply-To: <20031003163040.3641f39a.svb@ucs.co.za> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310031108.49002.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/98 X-Sequence-Number: 3846 Stef, > I've been trying to find out if some guidelines > exist, somewhere, describing how postgres > can possibly run on less than 8MB of RAM. > (Disk space not an issue). I can tell you from experience that you will get some odd behaviour, and even connection failures, when Postgres is forced into swap by lack of memory. Also, you will run into trouble with the default Linux kernel 2.4 VM manager, which allows applications to overcommit memory; either hack your own memory manager, or designate swap space >= 200% of RAM. Also, program your application to expect, and recover from, PostgreSQL failures and connection failures. > Is it possible to have a stripped-down version of > postgres that will use an absolute minimal amount > of memory? I don;t know that there is anything you can remove safely from the postgres core that would save you memory. > Maybe by switching off some features/options > at compile time, and/or configuration tweaks? > (Or anything else) You're in luck; the default postgresql.conf file for 7.3 is actually cofigured for a low-memory, slow machine setup (which most other people bitch about). Here's a few other things you can do: 1. Make sure that the WAL files (pg_xlog) are on a seperate disk from the database files, either through mounting or symlinking. 2. Tweak the .conf file for low vacuum_mem (1024?), but vacuum very frequently, like every 1-5 minutes. Spend some time tuning your fsm_max_pages to the ideal level so that you're not allocating any extra memory to the FSM. 3. If your concern is *average* CPU/RAM consumption, and not peak load activity, increase wal_files and checkpoint_segments to do more efficient batch processing of pending updates as the cost of some disk space. If peak load activity is a problem, don't do this. 4. Tune all of your queries carefully to avoid anything requiring a RAM-intensive merge join or CPU-eating calculated expression hash join, or similar computation-or-RAM-intensive operations. -- Josh Berkus Aglio Database Solutions San Francisco