Обсуждение: shared memory

Поиск
Список
Период
Сортировка

shared memory

От
Varun Kacholia
Дата:
 hi ,
   I wanted to know whether it would be beneficial if one increases the
   shared memory buffer size ? (BTW  is it possible to increase it in pg
    ...i think it is fixed to 8k) alongwith increasing the number of shared
    memory   buffers.
   curiously yours
--
------
Varun
Do not kill time ... else time will kill you


Re: shared memory

От
Jan Wieck
Дата:
Varun Kacholia wrote:
>
>  hi ,
>    I wanted to know whether it would be beneficial if one increases the
>    shared memory buffer size ? (BTW  is it possible to increase it in pg
>     ...i think it is fixed to 8k) alongwith increasing the number of shared
>         memory   buffers.

The buffer size allways has to be the same as the database block size.
The latter defaults to 8K, can be changed at compile time, requires an
initdb then and is not recommended anyway.

Of course is increasing the number of shared buffers beneficial. It
usually increases the buffer hit rate in turn, causing lesser IO
operations and thus increasing the overall performance. If you're
setting up a dedicated DB server, I'd suggest starting with half of the
physical RAM configured as shared buffers and experimenting from there.
If it's not a dedicated server, lower the amount of shared buffers
accordingly.

>    curiously yours
> --
> ------
> Varun
> Do not kill time ... else time will kill you

Doesn't matter, it'll kill you anyway. Time is only natures way of
making sure that everything doesn't go wrong at once!

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

Re: shared memory

От
Curt Sampson
Дата:
On Mon, 17 Jun 2002, Jan Wieck wrote:

> Of course is increasing the number of shared buffers beneficial. It
> usually increases the buffer hit rate in turn, causing lesser IO
> operations and thus increasing the overall performance.

Yes, but the only savings may be in transferring the buffer between
the operating system's buffer cache and the postgres buffer cache.
Remember, the OS is doing buffering as well.

> If you're
> setting up a dedicated DB server, I'd suggest starting with half of the
> physical RAM configured as shared buffers and experimenting from there.

I'd guess that "half" is about the very worst value you could chose.
That will maximize the number of pages that are stored (in duplicate)
in both the OS and postgres buffers, and waste a lot of memory.

cjs
--
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC