pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: jose fuenmayor <jafn82@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Settings for writing!
Date: Sat, 02 Dec 2006 20:14:47 -0600
Message-ID: <1165112087.25316.25.camel@localhost.localdomain> (raw)
In-Reply-To: <69f2062a0611200521x5bf10321u906d8ca215485fd6@mail.gmail.com>
References: <69f2062a0611200521x5bf10321u906d8ca215485fd6@mail.gmail.com>

On Mon, 2006-11-20 at 13:21 +0000, jose fuenmayor wrote:
> Hi all, which paramaters can I modify in order to improve performance
> in wirting tasks (updates,inserts,copy), I have a database where there
> is a lot of writing, i have increase the shared_buffers but it seems
> to improve just the reading which are really fast (I have a table with
> like 
> 87 000 000  rows, the problem goes when writing)

Writing speed is normally more about HOW you write, and the hardware
you're writing to.

Can you group your writing queries into groups in a single larger query?

I.e.
begin;
insert (100 times)
commit;

You can also get some help sometimes by playing about with these
settings:

#wal_buffers = 8                # min 4, 8KB each
#commit_delay = 0               # range 0-100000, in microseconds
#commit_siblings = 5            # range 1-1000

# - Checkpoints -

#checkpoint_segments = 3        # in logfile segments, min 1, 16MB each
#checkpoint_timeout = 300       # range 30-3600, in seconds
#checkpoint_warning = 30        # 0 is off, in seconds

especially commit_siblings.

But the biggest improvement can come from hardware.  Using a battery
backed caching RAID controller is generally the primary answer.  Areca,
LSI (megaraid) and the 3WARE series controllers get good reviews, with
the Areca coming in ahead by some small percentage performancewise, and
the LSI having a lead in reported reliability / maturity of the driver.

Using layered RAID is often a big help too.  Having a RAID 1+0 (a bunch
of mirror sets (RAID1) combined in a stripe set (RAID0) gives very good
write and read performance and the best reliability.

This is a question, btw, best answered on pgsql-perform.  Admin is more
about backing up, creating users, managing schemas, etc...

Good luck with your system.



view thread (2+ messages)

Message-ID: <1165112087.25316.25.camel@localhost.localdomain>
Permalink:  ../1165112087.25316.25.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1165112087.25316.25.camel@localhost.localdomain

 · 

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: smarlowe@g2switchworks.com, jafn82@gmail.com
  Subject: Re: Settings for writing!
  In-Reply-To: <1165112087.25316.25.camel@localhost.localdomain>
  References: <69f2062a0611200521x5bf10321u906d8ca215485fd6@mail.gmail.com> <1165112087.25316.25.camel@localhost.localdomain>

* 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