Re: postgresql.conf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresql.conf
Date: 2001-11-19 15:59:57
Message-ID: 15338.1006185597@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mlw <markw(at)mohawksoft(dot)com> writes:
> "Server" would have a huge number of buffers,

Do you have any evidence whatsoever that that's actually a good idea?

Certainly the existing default configuration is ridiculously cramped
for modern machines. But I've always felt that NBuffers somewhere in
the low thousands should be plenty. If you have lots of main memory
then the kernel can be expected to use it for kernel-level disk
buffering, which should be nearly as good as buffering inside Postgres.
(Maybe better, considering that we have some routines that scan all our
buffers linearly ...) Moreover, if you request a huge chunk of shared
memory then you run a significant risk that the kernel will decide to
start swapping parts of it, at which point it definitely becomes a
loser. Swapping a dirty buffer out and back in before it finally gets
written to disk is counterproductive. You want to keep the number of
buffers small enough that they all stay pretty "hot" in the swapper's
eyes.

Basically, I think that it's best to give the kernel plenty of elbow
room to deal with memory pressures on its own terms. Even on a machine
that's nominally dedicated to running Postgres.

Awhile back I suggested raising the default configuration to 1000 or
so buffers, which would be slightly less silly than the current default
even if it's not optimal. Didn't get much feedback about the idea
though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message F Harvell 2001-11-19 16:16:49 Re: [HACKERS] bug or change in functionality in 7.2?
Previous Message Tom Lane 2001-11-19 15:45:18 Re: OCTET_LENGTH is wrong