From: matt <matt@ymogen.net>
To: Yaroslav Mazurak <yamazurak@Lviv.Bank.Gov.UA>
Cc: pgsql-performance@postgresql.org
Subject: Re: PostgreSQL performance problem -> tuning
Date: 07 Aug 2003 19:06:05 +0100
Message-ID: <1060279564.23083.164.camel@gibraltar.mattclark.net> (raw)
In-Reply-To: <3F328683.7050008@lviv.bank.gov.ua>
References: <Pine.LNX.4.33.0308071017240.18251-100000@css120.ihs.com>
<3F328683.7050008@lviv.bank.gov.ua>
> Mem: 71M Active, 23M Inact, 72M Wired, 436K Cache, 48M Buf, 208M Free
> Swap: 368M Total, 2852K Used, 366M Free
>
> It's right that I can figure that I can use 384M (total RAM) - 72M
> (wired) - 48M (buf) = 264M for PostgreSQL.
> Hence, if I set effective_cache_size to 24M (3072 8K blocks),
> reasonable value (less than 240M, say 48M) for sort_mem, some value for
> shared_buffers (i.e. 24M, or 6144 4K blocks (FreeBSD), or 3072 8K blocks
> (PostgreSQL)), and rest of RAM 264M (total free with OS cache) - 24M
> (reserved for OS cache) - 48M (sort) - 24M (shared) = 168M PostgreSQL
> allocate dynamically by himself?
Totally, utterly the wrong way around.
Start with 384M, subtract whatever is in use by other processes,
excepting kernel disk cache, subtract your PG shared buffers, subtract
(PG proc size + PG sort mem)*(max number of PG processes you need to run
- should be same as max_connections if thinking conservatively), leave
some spare room so you can ssh in without swapping, and *the remainder*
is what you should set effective_cache_size to. This is all in the
docs.
The key thing is: set effective_cache_size *last*. Note that Postgres
assumes your OS is effective at caching disk blocks, so if that
assumption is wrong you lose performance.
Also, why on _earth_ would you need 48MB for sort memory? Are you
seriously going to run a query that returns 48M of data and then sort
it, on a machine with 384M of RAM?
M
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-performance@postgresql.org
Cc: matt@ymogen.net, yamazurak@Lviv.Bank.Gov.UA
Subject: Re: PostgreSQL performance problem -> tuning
In-Reply-To: <1060279564.23083.164.camel@gibraltar.mattclark.net>
References: <Pine.LNX.4.33.0308071017240.18251-100000@css120.ihs.com> <3F328683.7050008@lviv.bank.gov.ua> <1060279564.23083.164.camel@gibraltar.mattclark.net>
* 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