Thread: Settings for writing!

Settings for writing!

From
"jose fuenmayor"
Date:
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)

I am using Mandiva linux 2006 x86_64 kernel 2.6.17
Postgresql 8.0.8
in a ML350G4
I really apreciate the help!
Thanks in advance!

Re: Settings for writing!

From
Scott Marlowe
Date:
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.