From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Christoph Anton Mitterer <christoph.anton.mitterer@physik.uni-muenchen.de>
To: pgsql-admin@postgresql.org
Subject: Re: how to make PostgreSQL using "all" memory and chaching the DB completely there
Date: Thu, 14 Jul 2011 13:25:53 -0500
Message-ID: <4E1EEE61020000250003F33F@gw.wicourts.gov> (raw)
In-Reply-To: <1310642850.28621.37.camel@gar-ws-etp71.garching.physik.uni-muenchen.de>
References: <1310642850.28621.37.camel@gar-ws-etp71.garching.physik.uni-muenchen.de>
>Christoph Anton Mitterer
<christoph.anton.mitterer@physik.uni-muenchen.de>
wrote:
> What we have here at the institute is a quite powerful server,
> whit about 100GB RAM that has a PostgreSQL running on it (with
> several DBs).
In one cluster (postmaster instance) or separate?
> Currently it's 8.4 but we shall switch to 9.x eventually. The
> database is (physical) size is currently at about 30 GB.
30 GB is the total of all the databases?
> What I'd like to have, is that Postgresql uses at MAX say 50%
> (~50GB) of the available memory.
The only way to do that is with OS limits, like ulimit. Of course,
if you set the shared_buffers well under that and use reasonable
settings for other parameters, it won't tend to go above that unless
the RAM is unused by any other process. If you really want to be
sure some amount of RAM is not used by *any* process, the best way
is to pull it out of the machine and set it on a shelf -- it will do
as much good there as sitting unused in a machine. ;-)
> And there it should completely cache the DB for _reading_.
If there's sufficient unused RAM on the machine, it will do this
automatically.
> When any writes occur, these should still be sent "immediately" to
> disk.
The writes are persisted on COMMIT (before the COMMIT statement
completes), unless you configure for unsafe values. Make sure that
fsync, full_page_writes, and synchronous_commit are all on.
Make sure you have a good RAID controller with battery-back-up
caching configured for write-back.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, christoph.anton.mitterer@physik.uni-muenchen.de
Subject: Re: how to make PostgreSQL using "all" memory and chaching the DB completely there
In-Reply-To: <4E1EEE61020000250003F33F@gw.wicourts.gov>
References: <1310642850.28621.37.camel@gar-ws-etp71.garching.physik.uni-muenchen.de> <4E1EEE61020000250003F33F@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox