Thread: Postgresql 9.0.6 Raid 5 or not please help.

Postgresql 9.0.6 Raid 5 or not please help.

From
tuanhoanganh
Date:
I have IBM x3560 with 2G RAM - RAID 5 3 disk - PostgreSQL 9.0.6 64bit on Windows 2003 64bit
I had read some tuning guide, it recomment not use RAID 5. So Raid 5 is bestter than 3 disk independent or not.

Here is my pgbench -h %HOST% -p 5433 -U postgres -c 10 -T 1800 -s 10 pgbench 

pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
Scale option ignored, using pgbench_branches table count = 10
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 1
duration: 1800 s
number of transactions actually processed: 775366
tps = 430.736191 (including connections establishing)
tps = 430.780400 (excluding connections establishing)

Sorry for my English.

Tuan Hoang Anh

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Thu, Dec 22, 2011 at 8:36 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
> I have IBM x3560 with 2G RAM - RAID 5 3 disk - PostgreSQL 9.0.6 64bit on
> Windows 2003 64bit
> I had read some tuning guide, it recomment not use RAID 5. So Raid 5 is
> bestter than 3 disk independent or not.
>
> Here is my pgbench -h %HOST% -p 5433 -U postgres -c 10 -T 1800 -s 10
> pgbench
>
> pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
> Scale option ignored, using pgbench_branches table count = 10
> starting vacuum...end.
> transaction type: TPC-B (sort of)
> scaling factor: 10
> query mode: simple
> number of clients: 10
> number of threads: 1
> duration: 1800 s
> number of transactions actually processed: 775366
> tps = 430.736191 (including connections establishing)
> tps = 430.780400 (excluding connections establishing)

RAID 5 is aweful.  Look up RAID 1E for 3 disks:
http://en.wikipedia.org/wiki/Non-standard_RAID_levels#RAID_1E

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Thu, Dec 22, 2011 at 8:55 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Thu, Dec 22, 2011 at 8:36 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
>> I have IBM x3560 with 2G RAM - RAID 5 3 disk - PostgreSQL 9.0.6 64bit on
>> Windows 2003 64bit
>> I had read some tuning guide, it recomment not use RAID 5. So Raid 5 is
>> bestter than 3 disk independent or not.
>>
>> Here is my pgbench -h %HOST% -p 5433 -U postgres -c 10 -T 1800 -s 10
>> pgbench
>>
>> pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
>> Scale option ignored, using pgbench_branches table count = 10
>> starting vacuum...end.
>> transaction type: TPC-B (sort of)
>> scaling factor: 10
>> query mode: simple
>> number of clients: 10
>> number of threads: 1
>> duration: 1800 s
>> number of transactions actually processed: 775366
>> tps = 430.736191 (including connections establishing)
>> tps = 430.780400 (excluding connections establishing)
>
> RAID 5 is aweful.  Look up RAID 1E for 3 disks:
> http://en.wikipedia.org/wiki/Non-standard_RAID_levels#RAID_1E

If Windows doesn't support RAID 1E then setup a mirror set and use the
third drive as a hot spare.  Still faster than RAID-5.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
tuanhoanganh
Date:
Thanks for your answer. But how performance between raid5 and one disk.

Please help me.
Thanks in advance

Tuan Hoang Anh


On Fri, Dec 23, 2011 at 11:00 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Thu, Dec 22, 2011 at 8:55 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> On Thu, Dec 22, 2011 at 8:36 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
>> I have IBM x3560 with 2G RAM - RAID 5 3 disk - PostgreSQL 9.0.6 64bit on
>> Windows 2003 64bit
>> I had read some tuning guide, it recomment not use RAID 5. So Raid 5 is
>> bestter than 3 disk independent or not.
>>
>> Here is my pgbench -h %HOST% -p 5433 -U postgres -c 10 -T 1800 -s 10
>> pgbench
>>
>> pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
>> Scale option ignored, using pgbench_branches table count = 10
>> starting vacuum...end.
>> transaction type: TPC-B (sort of)
>> scaling factor: 10
>> query mode: simple
>> number of clients: 10
>> number of threads: 1
>> duration: 1800 s
>> number of transactions actually processed: 775366
>> tps = 430.736191 (including connections establishing)
>> tps = 430.780400 (excluding connections establishing)
>
> RAID 5 is aweful.  Look up RAID 1E for 3 disks:
> http://en.wikipedia.org/wiki/Non-standard_RAID_levels#RAID_1E

If Windows doesn't support RAID 1E then setup a mirror set and use the
third drive as a hot spare.  Still faster than RAID-5.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Thu, Dec 22, 2011 at 11:18 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
> Thanks for your answer. But how performance between raid5 and one disk.

One disk will usually win, 2 disks (in a mirror) will definitely win.
RAID-5 has the highest overhead and the poorest performance,
especially if it's degraded (1 drive out) that simple mirroring
methods don't suffer from.  But even in an undegraded state it is
usually the slowest method.  RAID-10 is generally the fastest with
redundancy, and of course pure RAID-0 is fastest of all but has no
redundancy.

You should do some simple benchmarks with something like pgbench and
various configs to see for yourself.  For extra bonus points, break a
mirror (2 disk -> 1 disk) and compare it to RAID-5 (3 disk -> 2 disk
degraded) for performance.  The change in performance for a RAID-1 to
single disk degraded situation is usually reads are half as fast and
writes are just as fast.  For RAID-5 expect to see it drop by a lot.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
"Satoshi Nagayasu"
Date:
Hi,

In addition, when you have multiple hard drive, it needs to be considered to put a database cluster and wal files
separatelyon different spindles (hard drives), because of different I/O charasteristics, in particular update intensive
workload.

Generally speaking, having 4 disks, one RAID-1 pair for a database cluster and another RAID-1 pair for WAL files, would
befine. 

--
NAGAYASU Satoshi <satoshi.nagayasu@gmail.com>


-----Original Message-----
From: Scott Marlowe <scott.marlowe@gmail.com>
Sender: pgsql-performance-owner@postgresql.orgDate: Fri, 23 Dec 2011 00:05:31
To: tuanhoanganh<hatuan05@gmail.com>
Cc: <pgsql-performance@postgresql.org>
Subject: Re: [PERFORM] Postgresql 9.0.6 Raid 5 or not please help.

On Thu, Dec 22, 2011 at 11:18 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
> Thanks for your answer. But how performance between raid5 and one disk.

One disk will usually win, 2 disks (in a mirror) will definitely win.
RAID-5 has the highest overhead and the poorest performance,
especially if it's degraded (1 drive out) that simple mirroring
methods don't suffer from.  But even in an undegraded state it is
usually the slowest method.  RAID-10 is generally the fastest with
redundancy, and of course pure RAID-0 is fastest of all but has no
redundancy.

You should do some simple benchmarks with something like pgbench and
various configs to see for yourself.  For extra bonus points, break a
mirror (2 disk -> 1 disk) and compare it to RAID-5 (3 disk -> 2 disk
degraded) for performance.  The change in performance for a RAID-1 to
single disk degraded situation is usually reads are half as fast and
writes are just as fast.  For RAID-5 expect to see it drop by a lot.

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Mario Weilguni
Date:
Am 23.12.2011 08:05, schrieb Scott Marlowe:
> On Thu, Dec 22, 2011 at 11:18 PM, tuanhoanganh<hatuan05@gmail.com>  wrote:
>> Thanks for your answer. But how performance between raid5 and one disk.
> One disk will usually win, 2 disks (in a mirror) will definitely win.
> RAID-5 has the highest overhead and the poorest performance,
> especially if it's degraded (1 drive out) that simple mirroring
> methods don't suffer from.  But even in an undegraded state it is
> usually the slowest method.  RAID-10 is generally the fastest with
> redundancy, and of course pure RAID-0 is fastest of all but has no
> redundancy.
>
> You should do some simple benchmarks with something like pgbench and
> various configs to see for yourself.  For extra bonus points, break a
> mirror (2 disk ->  1 disk) and compare it to RAID-5 (3 disk ->  2 disk
> degraded) for performance.  The change in performance for a RAID-1 to
> single disk degraded situation is usually reads are half as fast and
> writes are just as fast.  For RAID-5 expect to see it drop by a lot.
>
I'm not so confident that a RAID-1 will win over a single disk. When it
comes to writes, the latency should be  ~50 higher (if both disk must
sync), since the spindles are not running synchronously. This applies to
softraid, not something like a battery-backend raid controller of course.

Or am I wrong here?




Re: Postgresql 9.0.6 Raid 5 or not please help.

From
alexandre - aldeia digital
Date:
> I'm not so confident that a RAID-1 will win over a single disk. When it
> comes to writes, the latency should be ~50 higher (if both disk must
> sync), since the spindles are not running synchronously. This applies to
> softraid, not something like a battery-backend raid controller of course.
>
> Or am I wrong here?
>

Software RAID-1 in Linux, can read data in all disks and generally
increase a lot the data rate in reads. In writes, for sure, the overhead
is great compared with a single disk, but not too much.


Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Fri, Dec 23, 2011 at 5:15 AM, alexandre - aldeia digital
<adaldeia@gmail.com> wrote:
>> I'm not so confident that a RAID-1 will win over a single disk. When it
>> comes to writes, the latency should be ~50 higher (if both disk must
>> sync), since the spindles are not running synchronously. This applies to
>> softraid, not something like a battery-backend raid controller of course.
>>
>> Or am I wrong here?
>>
>
> Software RAID-1 in Linux, can read data in all disks and generally increase
> a lot the data rate in reads. In writes, for sure, the overhead is great
> compared with a single disk, but not too much.

Exactly.  Unless you spend a great deal of time writing data out to
the disks, the faster reads will more than make up for a tiny increase
in latency for the writes to the drives.

As regards the other recommendation in this thread to use two mirror
sets one for xlog and one for everything else, unless you're doing a
lot of writing, it's often still a winner to just run one big 4 disk
RAID-10.

Of course the real winner is to put a hardware RAID controller with
battery backed cache between your OS and the hard drives, then the
performance of even just a pair of drives in RAID-1 will be quite
fast.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
tuanhoanganh
Date:
Thanks for all. I change to RAID 1 and here is new pg_bench result:

pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
Scale option ignored, using pgbench_branches table count = 10
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
query mode: simple
number of clients: 10
number of threads: 1
duration: 1800 s
number of transactions actually processed: 4373177
tps = 2429.396876 (including connections establishing)
tps = 2429.675016 (excluding connections establishing)
Press any key to continue . . .

Tuan Hoang ANh
On Fri, Dec 23, 2011 at 10:25 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Fri, Dec 23, 2011 at 5:15 AM, alexandre - aldeia digital
<adaldeia@gmail.com> wrote:
>> I'm not so confident that a RAID-1 will win over a single disk. When it
>> comes to writes, the latency should be ~50 higher (if both disk must
>> sync), since the spindles are not running synchronously. This applies to
>> softraid, not something like a battery-backend raid controller of course.
>>
>> Or am I wrong here?
>>
>
> Software RAID-1 in Linux, can read data in all disks and generally increase
> a lot the data rate in reads. In writes, for sure, the overhead is great
> compared with a single disk, but not too much.

Exactly.  Unless you spend a great deal of time writing data out to
the disks, the faster reads will more than make up for a tiny increase
in latency for the writes to the drives.

As regards the other recommendation in this thread to use two mirror
sets one for xlog and one for everything else, unless you're doing a
lot of writing, it's often still a winner to just run one big 4 disk
RAID-10.

Of course the real winner is to put a hardware RAID controller with
battery backed cache between your OS and the hard drives, then the
performance of even just a pair of drives in RAID-1 will be quite
fast.

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Fri, Dec 23, 2011 at 8:32 AM, tuanhoanganh <hatuan05@gmail.com> wrote:
> Thanks for all. I change to RAID 1 and here is new pg_bench result:
>
> pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
> Scale option ignored, using pgbench_branches table count = 10
> starting vacuum...end.
> transaction type: TPC-B (sort of)
> scaling factor: 10
> query mode: simple
> number of clients: 10
> number of threads: 1
> duration: 1800 s
> number of transactions actually processed: 4373177
> tps = 2429.396876 (including connections establishing)
> tps = 2429.675016 (excluding connections establishing)
> Press any key to continue . . .

Note that those numbers are really only possible if your drives are
lying about fsync or you have fsync turned off or you have a battery
backed caching RAID controller.  I.e. your database is likely not
crash-proof.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
tuanhoanganh
Date:
Thank for your information.
My postgresql config fsync default
#fsync = on # turns forced synchronization on or off
My RAID is ServeRAID M5015 SAS/SATA controller, in MegaRaid Store Manager it show BBU Present = YES.
Does it have battery backed caching RAID controller?
Please help me, I am newbie of RAID card manager.

Tuan Hoang Anh.


On Sat, Dec 24, 2011 at 1:06 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Fri, Dec 23, 2011 at 8:32 AM, tuanhoanganh <hatuan05@gmail.com> wrote:
> Thanks for all. I change to RAID 1 and here is new pg_bench result:
>
> pgbench -h 127.0.0.1 -p 5433 -U postgres -c 10  -T 1800  -s 10 pgbench
> Scale option ignored, using pgbench_branches table count = 10
> starting vacuum...end.
> transaction type: TPC-B (sort of)
> scaling factor: 10
> query mode: simple
> number of clients: 10
> number of threads: 1
> duration: 1800 s
> number of transactions actually processed: 4373177
> tps = 2429.396876 (including connections establishing)
> tps = 2429.675016 (excluding connections establishing)
> Press any key to continue . . .

Note that those numbers are really only possible if your drives are
lying about fsync or you have fsync turned off or you have a battery
backed caching RAID controller.  I.e. your database is likely not
crash-proof.

Re: Postgresql 9.0.6 Raid 5 or not please help.

From
Scott Marlowe
Date:
On Sat, Dec 24, 2011 at 8:13 PM, tuanhoanganh <hatuan05@gmail.com> wrote:
> Thank for your information.
> My postgresql config fsync default
> #fsync = on # turns forced synchronization on or off
> My RAID is ServeRAID M5015 SAS/SATA controller, in MegaRaid Store Manager it
> show BBU Present = YES.
> Does it have battery backed caching RAID controller?
> Please help me, I am newbie of RAID card manager.

Yep you've got battery backed caching RAID.   So regular pgbench tells
you how much faster RAID-1 is than RAID-5 at a read/write mixed load.
You can run it with a -s switch for a read only benchmark to get an
idea how much, if any, of a difference there is between the two.