1. Firebird and RAIDChoosing the right RAID configuration for Firebird. Paul Reeves IBPhoenix mail: email@example.com
2. IntroductionDisc drives have become so cheap that im-plementing RAID for a firebird server is nowvery affordable.
3. Intended Audience It is hard enough to sell clients your applica-tion, never mind get them to invest in a suit-able server. Your clients dont have much of an in-houseIT dept. Your Sys Admins dont see why you need adedicated RAID array for your departmentalserver. Unintended AudienceIf you are working for a company that canafford a million dollar SAN this talk may notbe much use to you.
4. The focus of this talkPrimarily looking at the day to day perform-ance issues that underly RAIDData recovery is not really considered.However data recovery is heavily impactedby choice of RAID.
5. What is RAID? Redundant Array of Inexpensive DiscsRedundant – if one disc fails the system continues.Array – Discs grouped together bring better performance.Inexpensive – Many cheap discs combined can work bet-ter than more expensive discs.
6. RAID is NOTAn alternative backup strategyRAID exists to overcome disc failure, notdata corruption.Data corruption is copied to all discs so al-ways make sure you make backups.
7. Redundancy has a priceAll RAID implementations require writing tomore than one disc.Database updates can actually becomeslower (in extreme cases).
8. Forget about the fancy RAID namesThere are just two basic types of RAID configuration Mirrored ParityAnd there is two types of No RAID at all JBOD Disc striping (concatenating) – RAID 0
9. JBODJust a Bunch Of DiscsWhere would we be without acronyms?
10. RAID 0Good for creating very largediscsA disaster waiting to happen.Not much use for databasestorage. Becomes very useful whencombined with other RAIDlevels.
11. Mirrored RAID Maintain identical data ontwo or more discs Each disc in the arrayrequires a write.Usually implemented asRAID 1 or RAID 10
12. Parity RAIDWrites data blocks on every N discs -1 plus parityblock(s).Distribution of data and parity blocks is evenlydistributed across all discs.All discs in array mustbe written to. Calculating parity costsread I/O.Usually implemented asRAID 5, RAID 50, RAID 6 or RAID 60.
13. Combining RAID levels. Two or more arrays are concatenated to make alarger array.
14. Choosing the correct RAID level Calculating Hard Disc performanceIOPS – Input / Output Operations Per Second For hard drives we first need to calculate averagelatency: Avg Latency = (60 / RPMs / 2) * 1000We then take the average seek time for the driveand derive the IOPS: IOPS = 1000 / (avg latency + avg seek)
15. A rough guide to IOPS for different disc speedsManufacturers dont always provide full specifica-tions but we can make a good guess. RPM Avg Avg RIOPS Avg WIOPS Latency Read Write Seek Seek 5,400 5.56 9.40 66 10.50 62 7,200 4.17 8.50 79 9.50 73 10,000 3.00 3.80 147 4.40 135 15,000 2.00 3.50 182 4.00 167
16. What does IOPS really mean?IOPS is a theoretical value.As such it has no relation to actual datathroughput.IOPS indicates the maximum number oftimes per second that a drive couldrandomly read or write to a disc.
17. Random and Sequential Access - not what they seemSequential access is almost non-existent ona server if more than one process isaccessing the discRandom is rarely random – usually severalblocks can be written in a single I/O.
18. The Write PenaltyRAID Min. No. Write CommentLevel Disks PenaltyJBOD / 1 1 One disc. One write.RAID 0RAID 1 2 2 Write penalty is directly related to the number of disks in the mirror. For three disks the penalty is 3.RAID 5 3 4 Every write requires a read of the data block in the stripe, a read of the existing parity block then the actual write of the updated data block and parity block.RAID 6 4 6 As for RAID 5 except extra parity block requires an additional read and write
19. Calculating RAID performanceThere is a simple formula:( ( DISK_WIOPS * NO_DISCS * %WRITES ) / WRITE_PENALTY )+ ( DISK_RIOPS * NO_DISCS * %READS )= Theoretical maximum random IOPS for a givenarray.
20. Using Two or Three Discs in a RAID
21. Four Disc RAID configurations
22. Six Disc RAID configurations
23. Eight Disc RAID configurations
24. Can slower discs be better value than faster discs?
25. Summary of TheoryAdding discs increases available IOPS.The Write Penalty is real.Write intensive applications always benefit fromMirrored RAID.For a given number of discs Mirrored RAID willalways outperform Parity RAID in Random I/Ounless the database is read only.
26. So much for theory.What about reality?
27. First, you need a RAID ControllerFirmware based RAID controllersSoftware based RAID controllersHardware based RAID controllers
28. Firmware RAIDAKA Fake RAID or Bios RAID.Usually built into Motherboard or on cheap disc controllercards.Not easily portable in the event of failure.Requires CPU and RAM from host.It brings the benefit of configuration in the bios. By extension, this allows the O/S to boot from the RAID. But it also renders remote recovery a problem.
29. Software RAIDPart of the O/SNo special hardware requiredRequires CPU and RAM from Host.No Vendor Lock-in.Portable – if Host fails just pop the discs into an-other computer.Linux implementation rich in functionality – aims toprovide top class RAID support.No BBU
30. Hardware RAIDCPU independentBuilt-in cacheBattery backup of cacheEase of configurationMulti-platform client GUI (HP, IBM?)Disc monitoringHot sparesHot swappingVendor lock-in.
31. A word about Stripe/Strip sizeWhat is it?Does it affect RAID choice?Does it affect FB page size?
32. RAID, Strip and Page Size
33. RAID Performance in the real worldCase study – HP Smart Array 410Case study – s/w RAID on Linux
34. INSERTS comparison HW RAID
35. INSERTS comparison SW RAID
36. UPDATES comparison HW RAID
37. UPDATES comparison SW RAID
38. SELECTS comparison HW RAID
39. SELECTS comparison SW RAIDResults similar to HW RAID
40. And what about SSD in all this? SSD raises the bar – IOPS do increase massively. Wear Levelling, TRIM, Garbage Collection andWrite Amplification pose real problems for databaseuse especially for MLC based flash drives. RAID and TRIM dont (yet) work together. Not all SSDs are created equal – check bench-marks from a reliable h/w test site. Dont believe the manufacturers specs. Do your own real world tests. Smaller drives seem to have poorer performance! Price / Capacity ratio is still a hindrance to uptake. SS Drives can still fail and when they do, failure istotal.
41. Conclusion Weve compared parity and mirrored RAID at thefundamental, theoretical level.Weve also looked at some real world examplesof RAID. Although parity RAID can be tweaked it cannotout perform a mirrored RAID implementation ofthe same spec when deploying a databaseserver.