pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: David Teran <david.teran@cluster9.com>
Cc: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: cache whole data in RAM
Date: Tue, 3 Feb 2004 07:27:39 -0600
Message-ID: <20040203132739.GA1468@wolff.to> (raw)
In-Reply-To: <13E980A8-5648-11D8-BC99-000A95A6F0DC@cluster9.com>
References: <13E980A8-5648-11D8-BC99-000A95A6F0DC@cluster9.com>

On Tue, Feb 03, 2004 at 13:54:17 +0100,
  David Teran <david.teran@cluster9.com> wrote:
> Hi,
> 
> we are trying to speed up a database which has about 3 GB of data. The 
> server has 8 GB RAM and we wonder how we can ensure that the whole DB 
> is read into RAM. We hope that this will speed up some queries.

The OS should do this on its own. What you don't want to do is set
shared_buffers (in postgresql.conf) too high. From what I remember
from past discussions it should be something between about 1000 and 10000.

sort_mem is trickier since that memory is per sort and a single query
can potentially generate multiple parallel sorts. You will have to
make some guesses for this based on what you think the number of concurrent
sorts will be when the system is stressed and not use too much memory.
You might also find that after a point you don't get a lot of benefit
from increasing sort_mem.

You should set effective_cache_size pretty large. Probably you want to
subtract the space used by shared_buffers and sort_mem (* times estimated
parallel sorts) and what you think is reasonable overhead for other
processes from the 8GB of memory.

Since your DB's disk blocks will almost certainly all be in buffer cache,
you are going to want to set random_page_cost to be pretty close to 1.



view thread (5+ messages)  latest in thread

Message-ID: <20040203132739.GA1468@wolff.to>
Permalink:  ../20040203132739.GA1468@wolff.to/
Also on:    postgresql.org/message-id/20040203132739.GA1468@wolff.to

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, david.teran@cluster9.com
  Subject: Re: cache whole data in RAM
  In-Reply-To: <20040203132739.GA1468@wolff.to>

* 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