Re: Settings for writing!

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: jose fuenmayor <jafn82(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Settings for writing!
Date: 2006-12-03 02:14:47
Message-ID: 1165112087.25316.25.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Andy Shellam (Mailing Lists) 2006-12-03 11:29:46 Re: Lost password to user postgres
Previous Message Scott Marlowe 2006-12-02 23:25:23 Re: Lost password to user postgres