Re: How to - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: How to
Date
Msg-id 4D4FE22C020000250003A531@gw.wicourts.gov
Whole thread Raw
In response to Re: How to  (Nicolas Thauvin <nicolas.thauvin@dalibo.com>)
List pgsql-admin
Nicolas Thauvin <nicolas.thauvin@dalibo.com> wrote:
> On 06/02/2011 17:30, Kevin Grittner wrote:
>> Guy Deleeuw  wrote:
>>
>> My hardware : lapto hp envy I7 processor with a ssd disk
>>
>>> Memory :
>>>                  total    used     free shared buffers cached
>>>                8129356 2866516  5262840      0  387172 948132
>>> -/+ buffers/cache:     1531212  6598144
>>> Swap:         15625208       0 15625208
>>
>> It looks like everything you're running, including caching the
>> entire database, or at least the active part of it, fits in less
>> than 3 GB on your 8 GB machine.
>>
>>> shared_buffers = 24MB
>>
>> Given your hardware, I would bump that to 2GB or so.
>>
>> I would also set effective_cache_size to 7GB.
>
> Here I think it is too much because when the 2 GB of shared memory
> will be used, only 6 GB of RAM will be left and maybe not entirely
> used for file system cache. My way to find effective_cache_size
> value is to put it to 50% of the amount of ram, drop the cache
> after tuning, leaving the server live for a while and have a look
> at the output of free to find the final value.

Given that the usage of effective_cache_size seems to be an estimate
of how much will be effectively cached if a single query pounds away
at an index with random reads, adding shared buffers to the space
available for OS caching seems reasonable to me, and doing so
doesn't ever seem to have caused me problems.  On the other hand,
any size larger than your total database will be as effective as any
other size larger than your database.  ;-)

For me, the database is usually bigger than RAM, so I just add
shared_buffers to whatever "free" shows as cached.

-Kevin

pgsql-admin by date:

Previous
From: Nicolas Thauvin
Date:
Subject: Re: How to
Next
From: Chavdar Kopoev
Date:
Subject: PANIC: heap_update_redo: invalid lp