Re: performance issues

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: DHSC Webmaster <webmaster(at)dhs-club(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: performance issues
Date: 2001-06-14 15:51:35
Message-ID: 18087.992533895@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql

DHSC Webmaster <webmaster(at)dhs-club(dot)com> writes:
> Thank you Tom. That has seemed to help substantially.
> I received another sugestion to increase -B 30000 which would give 240
> meg. to postgres. I plan to give that a try. I've already reset the
> SHMMAX val in sysctl to accomodate that size. Do you see any reason not
> to try this? My thought is if some is good, more must be better. :)

Not always; there are several reasons why more can be worse:

1. It's a good idea to leave plenty of free RAM for kernel-level disk
buffering. Postgres has been tuned (to the extent that it is tuned)
to operate with a fair amount of kernel buffering underneath it.

2. If you are on a platform where the kernel thinks it can swap out
parts of shared memory (which is most platforms, these days), it's
counterproductive to make your shared mem large enough that it's not
all being used heavily. If the kernel decides to swap out some buffer
space, you have a net loss in performance, because you just wasted
disk I/O (especially if the page in the buffer is dirty --- it'll
eventually have to be read in again, then written out again, to no
purpose).

3. Also, there are some operations (such as dropping a table) which
cause linear scans of the whole buffer array, so making it too big
can slow things down, depending on your query mix.

While I have not done a lot of measurement to back this up, my rule of
thumb is that you don't want to reserve more than about a quarter of
your physical RAM for Postgres' disk buffers, even on a dedicated
machine. But feel free to experiment and see what results you get.
Please report back if you do any sort of organized tuning experiments;
AFAIK we don't have many hard numbers about these effects.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bruce Momjian 2001-06-14 16:35:31 Re: performance issues
Previous Message Lamar Owen 2001-06-14 15:45:23 Re: 7.0.3 -> 7.1.2; pg_setlocale error

Browse pgsql-sql by date

  From Date Subject
Next Message Alex K. 2001-06-14 16:09:02 casting varchar to numeric
Previous Message Jeff Eckermann 2001-06-14 15:42:23 RE: search/replace in update