pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
how to partition disks
9+ messages / 6 participants
[nested] [flat]

* how to partition disks
@ 2006-06-14 07:52  hubert depesz lubaczewski <depesz@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: hubert depesz lubaczewski @ 2006-06-14 07:52 UTC (permalink / raw)
  To: pgsql-performance

hi
i'm waiting for new server to arrive.
for the server i will get hp msa1000, with 14 discs (72g, 15000 rpm).
what kind of partitioning you suggest, to get maximum performance?
for system things i will have separate discs, so whole array is only for
postgresql.

data processing is oltp, but with large amounts of write operations.

any hints?

should i go with 3 partitions, or just 1? or 2?

depesz

-- 
http://www.depesz.com/ - nowy, lepszy depesz

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

* Re: how to partition disks
@ 2006-06-14 08:26  Sven Geisler <sgeisler@aeccom.com>
  parent: hubert depesz lubaczewski <depesz@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Sven Geisler @ 2006-06-14 08:26 UTC (permalink / raw)
  To: hubert depesz lubaczewski <depesz@gmail.com>; +Cc: pgsql-performance

Hi Hubert,

hubert depesz lubaczewski schrieb:
> hi
> i'm waiting for new server to arrive.
> for the server i will get hp msa1000, with 14 discs (72g, 15000 rpm).
> what kind of partitioning you suggest, to get maximum performance?
> for system things i will have separate discs, so whole array is only for 
> postgresql.
> 
> data processing is oltp, but with large amounts of write operations.
> 
> any hints?
> 
> should i go with 3 partitions, or just 1? or 2?
> 

You should configure your discs to RAID 10 volumes.
You should set up a separate volume for WAL.
A volume for an additional table space may also useful.

In your case I would do 2 partitions:

1. RAID 10 with 8 discs for general data
2. RAID 10 with 4 discs for WAL
(two disk as spare)

You may split the first volume in two volumes for a second table space 
if you Server doesn't have enough RAM and you have a high disk read I/O.


Cheers
Sven.



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

* Re: how to partition disks
@ 2006-06-14 11:21  hubert depesz lubaczewski <depesz@gmail.com>
  parent: Sven Geisler <sgeisler@aeccom.com>
  0 siblings, 2 replies; 9+ messages in thread

From: hubert depesz lubaczewski @ 2006-06-14 11:21 UTC (permalink / raw)
  To: Sven Geisler <sgeisler@aeccom.com>; +Cc: pgsql-performance

On 6/14/06, Sven Geisler <sgeisler@aeccom.com> wrote:
>
> You should configure your discs to RAID 10 volumes.
> You should set up a separate volume for WAL.
> A volume for an additional table space may also useful.
> In your case I would do 2 partitions:
> 1. RAID 10 with 8 discs for general data
>

raid 10 is of course not questionable. but are you sure that it will work
faster than for example:
2 discs (raid 1) for xlog
6 discs (raid 10) for tables
6 discs (raid 10) for indices?

depesz

-- 
http://www.depesz.com/ - nowy, lepszy depesz

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

* Re: how to partition disks
@ 2006-06-14 11:41  Sven Geisler <sgeisler@aeccom.com>
  parent: hubert depesz lubaczewski <depesz@gmail.com>
  1 sibling, 1 reply; 9+ messages in thread

From: Sven Geisler @ 2006-06-14 11:41 UTC (permalink / raw)
  To: hubert depesz lubaczewski <depesz@gmail.com>; +Cc: pgsql-performance

Hi Hupert,

hubert depesz lubaczewski schrieb:
> On 6/14/06, *Sven Geisler* <sgeisler@aeccom.com 
> <mailto:sgeisler@aeccom.com>> wrote:
>     You should configure your discs to RAID 10 volumes.
>     You should set up a separate volume for WAL.
>     A volume for an additional table space may also useful.
>     In your case I would do 2 partitions:
>     1. RAID 10 with 8 discs for general data
> 
> 
> raid 10 is of course not questionable. but are you sure that it will 
> work faster than for example:
> 2 discs (raid 1) for xlog
> 6 discs (raid 10) for tables
> 6 discs (raid 10) for indices?
> 

This depends on your application. Do you have a lot of disc reads?
Anyhow, I would put the xlog always to a RAID 10 volume because most of 
the I/O for update and inserts is going to the xlog.

4 discs xlog
6 discs tables
4 discs tables2

This should be better. You should distribute indices on separate spindle 
stacks to share the I/O. But again this depends on your application and 
your server. How are the indices used? How large is your file system 
cache. What does PostgreSQL effectively read from disc.

Don't forget to tune your postgresql.conf:
<http://www.powerpostgresql.com/PerfList;
<http://www.powerpostgresql.com/Downloads/terabytes_osc2005.pdf;

Cheers
Sven.



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

* Re: how to partition disks
@ 2006-06-14 14:23  Richard Broersma Jr <rabroersma@yahoo.com>
  parent: Sven Geisler <sgeisler@aeccom.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Richard Broersma Jr @ 2006-06-14 14:23 UTC (permalink / raw)
  To: Sven Geisler <sgeisler@aeccom.com>; hubert depesz lubaczewski <depesz@gmail.com>; +Cc: pgsql-performance

> > raid 10 is of course not questionable. but are you sure that it will 
> > work faster than for example:
> > 2 discs (raid 1) for xlog
> > 6 discs (raid 10) for tables
> > 6 discs (raid 10) for indices?
> > 
> 
> This depends on your application. Do you have a lot of disc reads?
> Anyhow, I would put the xlog always to a RAID 10 volume because most of 
> the I/O for update and inserts is going to the xlog.
> 
> 4 discs xlog
> 6 discs tables
> 4 discs tables2

I have a question in regards to I/O bandwidths of various raid configuration.  Primary, does the
above suggested raid partitions imply that multiple (smaller) disk arrays have a potential for
more I/O bandwidth than a larger raid 10 array?

Regards,

Richard





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

* Re: how to partition disks
@ 2006-06-14 14:32  Sven Geisler <sgeisler@aeccom.com>
  parent: Richard Broersma Jr <rabroersma@yahoo.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Sven Geisler @ 2006-06-14 14:32 UTC (permalink / raw)
  To: Richard Broersma Jr <rabroersma@yahoo.com>; +Cc: pgsql-performance

Hi Richard,

Richard Broersma Jr schrieb:
>> This depends on your application. Do you have a lot of disc reads?
>> Anyhow, I would put the xlog always to a RAID 10 volume because most of 
>> the I/O for update and inserts is going to the xlog.
>>
>> 4 discs xlog
>> 6 discs tables
>> 4 discs tables2
> 
> I have a question in regards to I/O bandwidths of various raid configuration.  Primary, does the
> above suggested raid partitions imply that multiple (smaller) disk arrays have a potential for
> more I/O bandwidth than a larger raid 10 array?

Yes.
Because the disc arms didn't need to reposition that much as there would 
o with one large volume.

For example, You run two queries with two clients and each queries needs 
to read some indices from disk. In this case it more efficient to read 
from different volumes than to read from one large volume where the disc 
arms has to jump.

Sven.



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

* Re: how to partition disks
@ 2006-06-14 15:16  Jim C. Nasby <jnasby@pervasive.com>
  parent: Sven Geisler <sgeisler@aeccom.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Jim C. Nasby @ 2006-06-14 15:16 UTC (permalink / raw)
  To: Sven Geisler <sgeisler@aeccom.com>; +Cc: Richard Broersma Jr <rabroersma@yahoo.com>; pgsql-performance

On Wed, Jun 14, 2006 at 04:32:23PM +0200, Sven Geisler wrote:
> Hi Richard,
> 
> Richard Broersma Jr schrieb:
> >>This depends on your application. Do you have a lot of disc reads?
> >>Anyhow, I would put the xlog always to a RAID 10 volume because most of 
> >>the I/O for update and inserts is going to the xlog.
> >>
> >>4 discs xlog
> >>6 discs tables
> >>4 discs tables2
> >
> >I have a question in regards to I/O bandwidths of various raid 
> >configuration.  Primary, does the
> >above suggested raid partitions imply that multiple (smaller) disk arrays 
> >have a potential for
> >more I/O bandwidth than a larger raid 10 array?
> 
> Yes.
> Because the disc arms didn't need to reposition that much as there would 
> o with one large volume.
> 
> For example, You run two queries with two clients and each queries needs 
> to read some indices from disk. In this case it more efficient to read 
> from different volumes than to read from one large volume where the disc 
> arms has to jump.

But keep in mind that all of that is only true if you have very good
knowledge of how your data will be accessed. If you don't know that,
you'll almost certainly be better off just piling everything into one
RAID array and letting the controller deal with it.

Also, if you have a good RAID controller that's batter-backed,
seperating pg_xlog onto it's own array is much less likely to be a win.
The reason you normally put pg_xlog on it's own partition is because the
database has to fsync pg_xlog *at every single commit*. This means you
absolutely want that fsync to be as fast as possible. But with a good,
battery-backed controller, this no longer matters. The fsync is only
going to push the data into the controller, and the controller will take
things from there. That means it's far less important to put pg_xlog on
it's own array. I actually asked about this recently and one person did
reply that they'd done testing and found it was better to just put all
their drives into one array so they weren't wasting bandwidth on the
pg_xlog drives.

Even if you do decide to keep pg_xlog seperate, a 4 drive RAID10 for
that is overkill. It will be next to impossible for you to generate
enough WAL traffic to warrent it.

Your best bet is to perform testing with your application. That's the
only way you'll truely find out what's going to work best. Short of
that, your best bet is to just pile all the drives together. If you do
testing, I'd start first with the effect of a seperate pg_xlog. Only
after you have those results would I consider trying to do things like
split indexes from tables, etc. 

BTW, you should consider reserving some of the drives in the array as
hot spares.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



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

* Re: how to partition disks
@ 2006-06-16 11:23  Michael Stone <mstone+postgres@mathom.us>
  parent: Sven Geisler <sgeisler@aeccom.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Michael Stone @ 2006-06-16 11:23 UTC (permalink / raw)
  To: pgsql-performance

On Wed, Jun 14, 2006 at 04:32:23PM +0200, Sven Geisler wrote:
>For example, You run two queries with two clients and each queries needs 
>to read some indices from disk. In this case it more efficient to read 
>from different volumes than to read from one large volume where the disc 
>arms has to jump.

Hmm. Bad example, IMO. In the case of reading indices you're doing 
random IO and the heads will be jumping all over the place anyway. The 
limiting factor there will be seeks/s, and you'll possibly get better 
results with the larger array. (That case is fairly complicated to 
analyze and depends very much on the data.) Where multiple arrays will be 
faster is if you have a lot of sequential IO--in fact, a couple of cheap 
disks can blow away a fairly expensive array for purely sequential 
operations since each disk can handle >60MB/s of if it doesn't have to 
seek, whereas multiple sequential streams on the big array will cause 
each disk in the array to seek. (The array controller will try to hide 
this with its cache; its cache size & software will determine how 
successful it is at doing so.)

Mike Stone



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

* Re: how to partition disks
@ 2006-09-01 12:20  Francisco Reyes <lists@stringsutils.com>
  parent: hubert depesz lubaczewski <depesz@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Francisco Reyes @ 2006-09-01 12:20 UTC (permalink / raw)
  To: hubert depesz lubaczewski <depesz@gmail.com>; +Cc: Sven Geisler <sgeisler@aeccom.com>; pgsql-performance

hubert depesz lubaczewski writes:

> On 6/14/06, Sven Geisler 
> raid 10 is of course not questionable. but are you sure that it will work 
> faster than for example:
> 2 discs (raid 1) for xlog
> 6 discs (raid 10) for tables
> 6 discs (raid 10) for indices?


Caching up on the performance list.
Although this may not help the original poster.. wanted to share a recent 
experience related to allocation of disks on a raid.

We just got a server with 16 disks.
We condfigured 12 to 1 raid controller and a second raid with 4. Both using 
raid 10.

RAID 1
10 x 7,200rpm disks
2 hot spares

RAID 2
4 x 10,000 rpm disk

One of the things I always do with new machines is to run bonnie++ and get 
some numbers.

I expected the second raid to have better numbers than the first because the 
disks were 10K drives (all SATA). To my surprise the larger raid had better 
numbers.

So I figure the number of spindles on a single RAID does make a big 
difference. To that regard splitting 16 disks into 3 sets may help with data 
needing to be read/written to be in separate raids, but may degrade 
performance by reducing the number of spindles on each of the raids.   



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


end of thread, other threads:[~2006-09-01 12:20 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-06-14 07:52 how to partition disks hubert depesz lubaczewski <depesz@gmail.com>
2006-06-14 08:26 ` Sven Geisler <sgeisler@aeccom.com>
2006-06-14 11:21   ` hubert depesz lubaczewski <depesz@gmail.com>
2006-06-14 11:41     ` Sven Geisler <sgeisler@aeccom.com>
2006-06-14 14:23       ` Richard Broersma Jr <rabroersma@yahoo.com>
2006-06-14 14:32         ` Sven Geisler <sgeisler@aeccom.com>
2006-06-14 15:16           ` Jim C. Nasby <jnasby@pervasive.com>
2006-06-16 11:23           ` Michael Stone <mstone+postgres@mathom.us>
2006-09-01 12:20     ` Francisco Reyes <lists@stringsutils.com>

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