pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: ProstGreSQL on RAID Question
5+ messages / 3 participants
[nested] [flat]

* Re: ProstGreSQL on RAID Question
@ 2002-08-12 03:30  Curt Sampson <cjs@cynic.net>
  parent: Chris Ruprecht <chrup@earthlink.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Curt Sampson @ 2002-08-12 03:30 UTC (permalink / raw)
  To: Chris Ruprecht <chrup@earthlink.net>; +Cc: pgsql-admin

On Mon, 12 Aug 2002, Chris Ruprecht wrote:

> I have set up a RAID-5 (soft RAID) arrray on my Linux machine,
> consisting of 5 18 GB UltraSCSI-2 (80 MB/sec) drives. Everythinng is
> working but I would like to know, where I can tweak this for optimum
> performance.

If you do a lot of inserts, move the log file ($PGDATA/pg_xlog)
off the RAID-5 and on to a separate RAID-1 (mirrored) pair. This will
separate the buffered random writes to the data files and the unbuffered,
sequential writes to the log.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* ProstGreSQL on RAID Question
@ 2002-08-12 06:20  Chris Ruprecht <chrup@earthlink.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Chris Ruprecht @ 2002-08-12 06:20 UTC (permalink / raw)
  To: pgsql-admin

Hi all,

I have set up a RAID-5 (soft RAID) arrray on my Linux machine, consisting of 5 
18 GB UltraSCSI-2 (80 MB/sec) drives. Everythinng is working but I would like 
to know, where I can tweak this for optimum performance.

The HOWTO, I found, said to set this up using a 32 KB chunk size for the 4 KB 
ext2 filesystems. I know that PostGreSQL is using 8 KB blocks, should it 
therefore not be better to set up the array, using 8 KB chunks? Or should I 
increase the chunk size?

The array is only for use by the $PGDATA directory, nothing else will go 
there, so this can be optimized for PG without any  consideration for 
anything else.

Any input welcome.

Best regards,
Chris




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ProstGreSQL on RAID Question
@ 2002-08-17 01:31  Chris Ruprecht <chrup@earthlink.net>
  parent: Curt Sampson <cjs@cynic.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Chris Ruprecht @ 2002-08-17 01:31 UTC (permalink / raw)
  To: Curt Sampson <cjs@cynic.net>; +Cc: pgsql-admin

Thanks Curt - yes, I have the log files on a different drive all together.
I was thinking more along the lines of OS block size (4 KB) vs. Postgres block 
size (8 KB by default) vs. RAID block size (32 KB). Is there anything I 
should change?

I would like to experiment but a 20 GB DB takes some time to backup and 
restore, so I'd like to tap into other's experiences.

Best regards,
Chris



On Sun August 11 2002 23:30, you wrote:
> On Mon, 12 Aug 2002, Chris Ruprecht wrote:
> > I have set up a RAID-5 (soft RAID) arrray on my Linux machine,
> > consisting of 5 18 GB UltraSCSI-2 (80 MB/sec) drives. Everythinng is
> > working but I would like to know, where I can tweak this for optimum
> > performance.
>
> If you do a lot of inserts, move the log file ($PGDATA/pg_xlog)
> off the RAID-5 and on to a separate RAID-1 (mirrored) pair. This will
> separate the buffered random writes to the data files and the unbuffered,
> sequential writes to the log.
>
> cjs




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ProstGreSQL on RAID Question
@ 2002-08-17 06:32  Curt Sampson <cjs@cynic.net>
  parent: Chris Ruprecht <chrup@earthlink.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Curt Sampson @ 2002-08-17 06:32 UTC (permalink / raw)
  To: Chris Ruprecht <chrup@earthlink.net>; +Cc: pgsql-admin

On Fri, 16 Aug 2002, Chris Ruprecht wrote:

> Thanks Curt - yes, I have the log files on a different drive all
> together. I was thinking more along the lines of OS block size (4 KB)
> vs. Postgres block size (8 KB by default) vs. RAID block size (32 KB).
> Is there anything I should change?

The RAID stripe size is not a big deal; generally you want to keep
it smallish to maximize the number of outstanding requests you can
service at the same time, but I find more often that it's the raid
controller limiting me on this point.

OS block size might as well be the same as postgresql block size;
making it smaller just increases the chances that a block you need
will only be "half" in the cache, and thus require a disk read
anyway.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.netbsd.org
    Don't you know, in this new Dark Age, we're all light.  --XTC




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: ProstGreSQL on RAID Question
@ 2002-08-28 23:31  nikolaus@dilger.cc
  0 siblings, 0 replies; 5+ messages in thread

From: nikolaus@dilger.cc @ 2002-08-28 23:31 UTC (permalink / raw)
  To: chrup@earthlink.net; +Cc: cjs@cynic.net; pgsql-admin

Chris,

You should be fine.

For each Postgres block you are reading 2 OS blocks. 
That's fine.  The other way around would be bad.

The optimal RAID block size depends on things like read
 ahead algorithms for large sequential reads.

If it ain't broke, don't fix it.

Regards,
Nikolaus Dilger


On Fri, 16 August 2002, Chris Ruprecht wrote:

> 
> Thanks Curt - yes, I have the log files on a different
> drive all together.
> I was thinking more along the lines of OS block size
(4
> KB) vs. Postgres block 
> size (8 KB by default) vs. RAID block size (32 KB). Is
> there anything I 
> should change?
> 
> I would like to experiment but a 20 GB DB takes some
> time to backup and 
> restore, so I'd like to tap into other's experiences.
> 
> Best regards,
> Chris
> 
> 
> 
> On Sun August 11 2002 23:30, you wrote:
> &gt; On Mon, 12 Aug 2002, Chris Ruprecht wrote:
> &gt; &gt; I have set up a RAID-5 (soft RAID) arrray
on my
> Linux machine,
> &gt; &gt; consisting of 5 18 GB UltraSCSI-2 (80
MB/sec)
> drives. Everythinng is
> &gt; &gt; working but I would like to know, where I
can tweak
> this for optimum
> &gt; &gt; performance.
> &gt;
> &gt; If you do a lot of inserts, move the log file
> ($PGDATA/pg_xlog)
> &gt; off the RAID-5 and on to a separate RAID-1
(mirrored)
> pair. This will
> &gt; separate the buffered random writes to the data
files
> and the unbuffered,
> &gt; sequential writes to the log.
> &gt;
> &gt; cjs
> 
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send
> an appropriate
> subscribe-nomail command to majordomo@postgresql.org
so
> that your
> message can get through to the mailing list cleanly



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2002-08-28 23:31 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-12 06:20 ProstGreSQL on RAID Question Chris Ruprecht <chrup@earthlink.net>
2002-08-12 03:30 ` Curt Sampson <cjs@cynic.net>
2002-08-17 01:31   ` Chris Ruprecht <chrup@earthlink.net>
2002-08-17 06:32     ` Curt Sampson <cjs@cynic.net>
2002-08-28 23:31 Re: ProstGreSQL on RAID Question nikolaus@dilger.cc

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