Thread: Fwd: Multiple disks: RAID 5 or PG Cluster

Fwd: Multiple disks: RAID 5 or PG Cluster

From
Yves Vindevogel
Date:
cc ...


Begin forwarded message:


<excerpt><bold><color><param>0000,0000,0000</param>From:
</color></bold>Yves Vindevogel <<yves.vindevogel@implements.be>

<bold><color><param>0000,0000,0000</param>Date: </color></bold>Sat 18
Jun 2005 18:18:53 CEST

<bold><color><param>0000,0000,0000</param>To: </color></bold>PFC
<<lists@boutiquenumerique.com>

<bold><color><param>0000,0000,0000</param>Subject: </color>Re:
[PERFORM] Multiple disks: RAID 5 or PG Cluster

</bold>

There's a basic difference between striping (raid 0) and mirroring
(raid 1)


With striping, each file is distributed over several disks, making the
physical write faster because several disks can do the work.  Same for
reading, multiple disks return a part of the file.

Striping can not be used for safety/backup, if one disk fails, your
file is lost (if it is partly on that failing disk).  With mirroring
you do not lose any disk space.


Mirroring is a technique for avoiding disasters when you have a disk
failure.  Every file is written twice, each time to a different disk,
which is a mirror of the first one.

You effectively lose half of your diskspace to that mirror.  But when
a disk fails, you don't lose anything, since you can rely on the other
mirrored disk.


Raid 10, which is the combination of that, has both.  You have
multiple disks that form your first part of the raid and you have an
equal amount of disks for the mirror.

On each part of the mirror, striping is used to spread the files like
in a raid 0.  This is a very costly operation.  You need a minimum of
4 disks, and you lose 50% of your capacity.


BTW: mirroring is always slower than striping.


On 18 Jun 2005, at 18:00, PFC wrote:


<excerpt>


<excerpt>I do not know what clustering would do for you.  But striping
will provide a

high level of assurance that each of your hard drives will process
equivalent

amounts of IO operations.

</excerpt>

    I don't know what I'm talking about, but wouldn't mirorring be faster
than striping for random reads like you often get on a database ? (ie.
the reads can be dispatched to any disk) ? (or course, not for writes,
but if you won't use fsync, random writes should be reduced no ?)





---------------------------(end of
broadcast)---------------------------

TIP 5: Have you checked our extensive FAQ?


              http://www.postgresql.org/docs/faq



</excerpt>Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller></excerpt>cc ...

Begin forwarded message:

> From: Yves Vindevogel <yves.vindevogel@implements.be>
> Date: Sat 18 Jun 2005 18:18:53 CEST
> To: PFC <lists@boutiquenumerique.com>
> Subject: Re: [PERFORM] Multiple disks: RAID 5 or PG Cluster
>
> There's a basic difference between striping (raid 0) and mirroring
> (raid 1)
>
> With striping, each file is distributed over several disks, making the
> physical write faster because several disks can do the work.  Same for
> reading, multiple disks return a part of the file.
> Striping can not be used for safety/backup, if one disk fails, your
> file is lost (if it is partly on that failing disk).  With mirroring
> you do not lose any disk space.
>
> Mirroring is a technique for avoiding disasters when you have a disk
> failure.  Every file is written twice, each time to a different disk,
> which is a mirror of the first one.
> You effectively lose half of your diskspace to that mirror.  But when
> a disk fails, you don't lose anything, since you can rely on the other
> mirrored disk.
>
> Raid 10, which is the combination of that, has both.  You have
> multiple disks that form your first part of the raid and you have an
> equal amount of disks for the mirror.
> On each part of the mirror, striping is used to spread the files like
> in a raid 0.  This is a very costly operation.  You need a minimum of
> 4 disks, and you lose 50% of your capacity.
>
> BTW: mirroring is always slower than striping.
>
> On 18 Jun 2005, at 18:00, PFC wrote:
>
>>
>>
>>> I do not know what clustering would do for you.  But striping will
>>> provide a
>>> high level of assurance that each of your hard drives will process
>>> equivalent
>>> amounts of IO operations.
>>
>>     I don't know what I'm talking about, but wouldn't mirorring be
>> faster than striping for random reads like you often get on a
>> database ? (ie. the reads can be dispatched to any disk) ? (or
>> course, not for writes, but if you won't use fsync, random writes
>> should be reduced no ?)
>>
>>
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 5: Have you checked our extensive FAQ?
>>
>>               http://www.postgresql.org/docs/faq
>>
>>
> Met vriendelijke groeten,
> Bien à vous,
> Kind regards,
>
> Yves Vindevogel
> Implements
>
<excerpt><smaller>


Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.</x-tad-smaller></italic></smaller></excerpt><excerpt>


</excerpt>Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller>>
>
> Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91
>
> Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76
>
> Web: http://www.implements.be
>
> First they ignore you.  Then they laugh at you.  Then they fight you.
> Then you win.
> Mahatma Ghandi.
>
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

<smaller>


Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.</x-tad-smaller></italic></smaller>



Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76

Web: http://www.implements.be

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.
Mahatma Ghandi.

Attachment

Re: Fwd: Multiple disks: RAID 5 or PG Cluster

From
Michael Stone
Date:
On Sat, Jun 18, 2005 at 06:42:27PM +0200, Yves Vindevogel wrote:
>>With striping, each file is distributed over several disks, making
>>the physical write faster because several disks can do the work.
>>Same for reading, multiple disks return a part of the file.

A mirror behaves almost exactly the same for reads, with a caveat: for a
large enough file, multiple disks *must* be accessed in a striped
configuration, while in a mirrored configuration the controller may
access either one or more disks to read any file.

>>BTW: mirroring is always slower than striping.

That's simply not true. Striping speeds up writes but has no advantage
over a simlarly sized mirror for reading. In fact, the mirror will be
faster for pathological cases in which the reads are aligned in such a
way that they would all be have to be read from the same stripe of a
striped array. The striped configuration has an advantage when more than
two disks are used, but that derives from the number of spindles, not
from the striping; it is possible to have a mirror of more than two
disks (which would have the same read advantage as the striped
configuration with the same number of disks) but this is rarely seen
because it is expensive.

Mike Stone

Re: Fwd: Multiple disks: RAID 5 or PG Cluster

From
Greg Stark
Date:
Michael Stone <mstone+postgres@mathom.us> writes:

> it is possible to have a mirror of more than two disks (which would have the
> same read advantage as the striped configuration with the same number of
> disks) but this is rarely seen because it is expensive.

Actually three-way mirrors are quite common for backup purposes. To take a
backup you break the mirror by taking one of the three copies out. Back it up
at your leisure, then just resync it in time for the next backup.

--
greg