pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan <postgresql@phreaker.net>
To: pgsql-admin@postgresql.org
Subject: Re: Performance Issues
Date: Mon,  8 Sep 2003 06:44:09 -0300 (ADT)
Message-ID: <20030908094409.7634DD1B50A@svr1.postgresql.org> (raw)
In-Reply-To: <4223A04BF7D1B941A25246ADD0462FF5CD7C15@blr-m3-msg.wipro.com>

On Mon, Sep 08, 2003 at 11:43:42AM +0530, Ravi T Ramachandra wrote:
> I recently setup postgres on a Linux box with 4GB Ram and 2.5 GHz
> processor.

Big box.

> We have created a database with 1.5 million rows in a
> table. 

Small database.

> When we try to select rows from the table, it is taking enormous
> time with the default configuration.

Problem is very probably default configuration (you didn't
say which postgresql version you had, it would have been
interesting, but no matter, or specify that your performance
results were consistent during several runs without reboot, but
I suppose so).

Default configuration is for a small box, or a small database,
or "extremely conservative", whatever. It's "the size that
works for everybody", for some modest value of "work". That's
very different from "one size fits all", and you'll agree that
postgresql can't expect to have 4 GB of RAM to play with on most
machines.

You want to tune performance :-)

To begin with, you want to bump shared_buffers from 64 or
512 to 4096 at the very least, probably all the way to say
32768 or maybe 65536 or even more, I don't know if there's
an upper limit, soft or hard (I've never had more than 1GB
RAM on a machine so I've never wondered <jealous> :-) ) Note
that "cat /proc/sys/kernel/shmmax" should be more or equal to
shared_buffers*8192, otherwise maybe postmaster won't start,
a quick check says that my untuned Linux is at 4096*8192. To
change that, umm, google, yes:

http://www.lyris.com/lm_help/7.5/tuning_postgresql.html

which has a lot of other tips.

Continuing in that vein yields

http://www.varlena.com/GeneralBits/Tidbits/perf.html
http://developer.postgresql.org/docs/postgres/kernel-resources.html

And more in-depth:

http://candle.pha.pa.us/main/writings/pgsql/performance.pdf
http://www.argudo.org/postgresql/soft-tuning.html

If you still have performance problems after a dose of that
medicine I'll be very surprised :-)

Nathan



view thread (12+ messages)  latest in thread

Message-ID: <20030908094409.7634DD1B50A@svr1.postgresql.org>
Permalink:  ../20030908094409.7634DD1B50A@svr1.postgresql.org/
Also on:    postgresql.org/message-id/20030908094409.7634DD1B50A@svr1.postgresql.org

 · 

reply

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-admin@postgresql.org
  Cc: postgresql@phreaker.net
  Subject: Re: Performance Issues
  In-Reply-To: <20030908094409.7634DD1B50A@svr1.postgresql.org>
  References: <4223A04BF7D1B941A25246ADD0462FF5CD7C15@blr-m3-msg.wipro.com> <20030908094409.7634DD1B50A@svr1.postgresql.org>

* 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