pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: Prajakt Deolasee <bugzilla.prajakt@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Postgres is slow
Date: Tue, 08 Mar 2005 10:17:29 -0800
Message-ID: <422DEC39.2010104@hogranch.com> (raw)
In-Reply-To: <6bf1b0a0050308095142eef89b@mail.gmail.com>
References: <6bf1b0a005030805495ec76763@mail.gmail.com>
	<Pine.LNX.4.58.0503081502170.27514@www.forgeahead.hu>
	<422DE271.5010701@hogranch.com>
	<6bf1b0a0050308095142eef89b@mail.gmail.com>

> John, do you have any idea which parameters to change?

up the buffer size (I don't have the docs in front of me, I'm at a iinternet 
cafe on wifi at the moment), set WAL_SYNC_TYPE (or whatevr it is) to fdatasync, 
up the wal buffers some too, increase the sort buffer size significantly, yada 
yada.   don't go overboard, just reasonable.   I usually use about 10000 main 
buffers (80MB).

> I tried similar tests also against PSQL 8.0 as well. But the results
> are exactly same.
> 
> My final usage is going to be exteremly high. I would need something
> like 1000 inserts/updates per sec. Do you think PSQL will scale?

watch your disk IO.  `iostat -x sda -x sdb -x sdc 5` is your friend (replace 
the sda b c with whatever your physical drives are called).   keep the await 
times under 100mS if you can.  *never* use RAID5 for database volumes, use 
raid1 or 10 (striped mirrors).  With postgres 8, you can split your tablespaces 
across several physical disk drives, this can help alot if you can balance your 
disk IO.   doing this requires some finesse and careful analysis of your 
database usage patterns.  postgres stats can help determine which tables are 
getting the most insert/update activity, you want to balance these across the 
available physical drives.

good database administrators who understand all this sort of tuning are a rare 
breed, and in demand.  I have a oracle DBA on staff who knows this stuff really 
well for oracle... the same principles apply to postgres, but are less well 
understood.




view thread (8+ messages)  latest in thread

Message-ID: <422DEC39.2010104@hogranch.com>
Permalink:  ../422DEC39.2010104@hogranch.com/
Also on:    postgresql.org/message-id/422DEC39.2010104@hogranch.com

 · 

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-jdbc@postgresql.org
  Cc: pierce@hogranch.com, bugzilla.prajakt@gmail.com
  Subject: Re: Postgres is slow
  In-Reply-To: <422DEC39.2010104@hogranch.com>
  References: <6bf1b0a005030805495ec76763@mail.gmail.com> <Pine.LNX.4.58.0503081502170.27514@www.forgeahead.hu> <422DE271.5010701@hogranch.com> <6bf1b0a0050308095142eef89b@mail.gmail.com> <422DEC39.2010104@hogranch.com>

* 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