Skip site navigation (1) Skip section navigation (2)

Re: Shared Memory Sizing

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Doug Fields <dfields-pg-general(at)pexicom(dot)com>,"Peter A(dot) Daly" <petedaly(at)ix(dot)netcom(dot)com>,<pgsql-general(at)postgresql(dot)org>
Subject: Re: Shared Memory Sizing
Date: 2002-06-27 03:53:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Wed, 26 Jun 2002, Bruce Momjian wrote:

> I advise in my hardware tuning guide that it be increased until paging
> starts, then reduce it, and start around 25%.  Is that OK?

I don't think that's optimal. The general gist is that if the OS
has as much free memory as postgres has shared memory used for
buffering, it's going to be buffering pretty much all the data that
posgres is. So every block that postgres holds is using 8K of memory
that the OS could use to cache a different block.

Now it's a bit more subtle than this in that copying a buffer
between postgres's shared memory and OS memory also has a cost,
and we should try to minimize that. But still, that's a lot cheaper
than moving a buffer between memory and disk.

This sort of thing is one of the main reasons I like the idea of
moving to mmap for data files; it gets rid of both the double
buffering and the copying back-and-forth. (And even if you do end
up copying, you still save the kernel/userland transition, which
is also a little bit expensive.)

Curt Sampson  <cjs(at)cynic(dot)net>   +81 90 7737 2974
    Don't you know, in this new Dark Age, we're all light.  --XTC

In response to


pgsql-general by date

Next:From: Nadim BitarDate: 2002-06-27 03:56:11
Subject: Large Objects
Previous:From: Christopher Kings-LynneDate: 2002-06-27 03:48:10
Subject: Re: (A) native Windows port

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group