From: | Josh Berkus <josh(at)agliodbs(dot)com> |
---|---|
To: | Stef <svb(at)ucs(dot)co(dot)za>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Postgres low end processing. |
Date: | 2003-10-03 18:08:48 |
Message-ID: | 200310031108.49002.josh@agliodbs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-performance |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Network Administrator | 2003-10-03 18:32:00 | Re: Type of application that use PostgreSQL |
Previous Message | Relaxin | 2003-10-03 18:06:11 | Re: PostgreSQL Beta4 Tag'd and Bundle'd ... |
From | Date | Subject | |
---|---|---|---|
Next Message | Ron Johnson | 2003-10-03 18:34:00 | Re: Postgres low end processing. |
Previous Message | Oleg Lebedev | 2003-10-03 18:04:23 | Re: TPC-R benchmarks |