Re: Upgrade to dual processor machine?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: shridhar_daithankar(at)persistent(dot)co(dot)in
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Upgrade to dual processor machine?
Date: 2002-11-13 14:11:03
Message-ID: 21152.1037196663@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

"Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in> writes:
> 3) Sort mem is a tricky affair. AFAIU, it is used only when you create
> index or sort results of a query. If do these things seldomly, you can
> set this very low or default.

I think this is bad advice. Sort memory is only consumed when needed,
so there's no advantage in decreasing the setting just because you think
a particular client process isn't going to need to sort. All you will
accomplish is to pessimize your performance if a sort does happen to be
needed.

You do need to set the installation default on the basis of thinking
about what will happen if all backends are trying to sort at once.
But having done that, you should be able to increase the setting in
individual sessions that you know are going to do large sorts.

The default setting (1024K) is, like most of the default settings
in PG, on the small side IMHO.

I don't care for advice that leads to allocating half of physical RAM to
PG's shared buffers, either. This ignores the fact that the kernel's
disk caches are nearly as effective as PG's internal buffers, and much
more flexible (because the kernel can decrease the size of its caches
when there's heavy memory pressure from processes). I'd start with a
few thousand shared buffers and let the kernel consume the bulk of RAM
with its buffering. That approach lets you use a higher sort_mem
setting, too.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-13 14:34:14 Re: SELECT INTO
Previous Message Csaba Nagy 2002-11-13 14:04:41 Re: Help..Help...

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2002-11-13 17:05:35 Re: Upgrade to dual processor machine?
Previous Message Doug McNaught 2002-11-13 13:52:14 Re: Upgrade to dual processor machine?