Re: Memory usage question - Mailing list pgsql-general

From Joe Conway
Subject Re: Memory usage question
Date
Msg-id 3D3B4C2F.8070405@joeconway.com
Whole thread Raw
In response to Re: Memory usage question  (Ralph Graulich <maillist@shauny.de>)
List pgsql-general
Ralph Graulich wrote:
>>Isn't postgres supposed to cache most of the database in memory, so as
>>to limit disk access?
> Check your settings for shared memory buffers in postgresql.conf and read
> the appropriate manpage in the documentation.

Specifically see:
http://www.postgresql.org/idocs/index.php?kernel-resources.html
and
http://www.postgresql.org/idocs/index.php?runtime-config.html

In postgresql.conf consider changing shared_buffers to something like:
    shared_buffers = 8192 (in 8K pages, which is equal to 64MB, the oft
    recommended 1/4 total RAM; play around, YMMV).

You may also want to set:

- sort_mem (I use 4096, but that isn't based on much in the way of
   empirical testing)
- wal_sync_method (I did enough testing with this to convince myself
   that on Linux with ext3, this is the best choice)

and possibly

- max_fsm_relations = 100
- max_fsm_pages = 10000 (search the archives for discussions on the free
   space map)

On all of this stuff, best advice is to play around to obtain the best
performance on your hardware with your data and queries.

HTH,

Joe


pgsql-general by date:

Previous
From: Ralph Graulich
Date:
Subject: Re: Memory usage question
Next
From: Martijn van Oosterhout
Date:
Subject: Cross-Tab queries in postgres?