[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: w/c RAID on a SQL box



On 2000-11-16 10:19, Santiago Palmier Campos wrote:
>As Rod said, RAID 1 is a mirroring solution and RAID 5 can be called
>something like "stripping with data recovery" ;)
>
>But what you must consider is...
>	RAID 1 is faster for _reading_ data (as it uses only 1 disk for
>read)

RAID-1 is faster IFF you have two processes/threads reading at the same time, 
then one thread reads from disk 0 and the other reads from disk 1.  If you 
have a single process reading then RAID-1 doesn't gain anything with the file 
systems in Linux.  Maybe XFS will improve this situation when it is released 
(agressive read-ahead on the other disk could improve read performance for a 
single process).

>	RAID 5 is faster for _writing_ data (as it distributes data across
>several disks)

IFF you are writing large amounts of data.  If you write a single sector to 
RAID-5 then it becomes 2 sector reads followed by 2 sector writes to keep the 
parity block correct.  This makes RAID-5 much slower than a single disk for 
small writes.  Don't run a mail server on RAID-5!!!

>If you app __mainly_writes__ a lot of data (INSERTs & UPDATEs) RAID 5 _is_
>your solution

RAID-0 + 1 AKA RAID-10 will outperform RAID-5 in every situation, but 
requires more disks (and more expense).

>OTOH you must have in mind that...
>	RAID 1 is _slower_ for _writing_ (same info into 2 disks)

No.  If your CPU and system busses are fast enough then RAID-1 will give the 
same write speed as a single disk.

>	RAID 5 is _slower_ for _reading_ (read info from several disks)
>If your app __mainly_reads__ a lot of data (SELECTs) RAID 1 is your solution

No.  Because RAID-5 is striping the data across N-1 disks (where N is the 
number of disks in the array) it will be faster on average for multiple 
processes/threads doing small reads because the reads can often be 
parallelised.  Also for a single process reading large amounts of data RAID-5 
is much faster than a single disk, it is also faster than a RAID-10 array of 
the same number of drives.

>What is "more secure"? Well...
>	RAID 1: same info on 2 disks... as safe as at least 1 disk is OK ;o)
>	RAID 5: safe if _only_ 1 disk fails. You can recover info on this
>disk with the info from the others, but if 2 disks fail at the same time
>=8-O ...
>
>IMHO RAID 5 is a better solution for "common apps", but for an DDBB app...
>you must evaluate the main operation you're doing: reading or writing, and
>then evaluate both options.
>
>I'll suggest RAID 5 for app files & RAID 1 for data storage, obviously with
>a good backup policy ;o) but I don't know if it's possible at your hosting
>company :o?

I suggest RAID-1 or RAID-10 everywhere every time if you can afford it.  I 
also suggest doing some benchmark tests before giving out advice on 
performance tuning.  See my .sig for programs you can use for benchmarking.

-- 
http://www.coker.com.au/bonnie++/     Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/       Postal SMTP/POP benchmark
http://www.coker.com.au/projects.html Projects I am working on
http://www.coker.com.au/~russell/     My home page



Reply to: