From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Vivek Khera <khera@kcilink.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Tunning FreeeBSD and PostgreSQL
Date: Tue, 22 Jul 2003 13:29:07 -0400 (EDT)
Message-ID: <200307221729.h6MHT7M02341@candle.pha.pa.us> (raw)
In-Reply-To: <16157.18467.310482.384436@yertle.int.kciLink.com>
Vivek Khera wrote:
> >>>>> "BM" == Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
> >> not anything pre-allocated (from my understanding). These settings
> >> allow for up to 100,000 shared buffers (I currently only use 30,000
> >> buffers)
>
> BM> I think the only downside to making them too big is that you allocate
> BM> page tables and prevent that address range from being used by other
>
> Does this apply in general or just on FreeBSD?
Let me tell you how it traditionally worked --- each process has the
kernel address space accessible at a fixed address --- it has to so the
process can make kernel calls and run those kernel calls in its own
address space, though with a kernel stack and data space.
What they did with shared memory was to put shared memory in the same
address space with the kernel, because everyone had that address range
mapped into their address space already. If each process had its own
private copy of the kernel page tables, there is bloat in having the
kernel address space be larger than required. However, if the kernel
page tables are shared by all processes, then there isn't much bloat,
just less addressable user memory, and if you don't have anything near 4
gigs of RAM, it isn't a problem.
I know Linux has pagable shared memory, and you can resize the maximum
in a running kernel, so it seems they must have abandonded the linkage
between shared page tables and the kernel. This looks interesting:
http://www.linux-tutorial.info/cgi-bin/display.pl?312&0&0&0&3
and the Contents on the left show additional info like the i386 virtual
directory/page tables:
http://www.linux-tutorial.info/cgi-bin/display.pl?261&0&0&0&3
So it seems Linux has moved in the direction of making shared memory act
just like ordinary allocated memory, except it is shared, meaning I
think each process has its own pages tables for the shared memory. Once
you do that, you get the ability to size it however you want, but you
lose shared page tables, and it can now be swapped out, which can be bad
for performance.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
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: pgman@candle.pha.pa.us, khera@kcilink.com
Subject: Re: Tunning FreeeBSD and PostgreSQL
In-Reply-To: <200307221729.h6MHT7M02341@candle.pha.pa.us>
References: <16157.18467.310482.384436@yertle.int.kciLink.com> <200307221729.h6MHT7M02341@candle.pha.pa.us>
* 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