{"id":897,"date":"2010-11-04T10:47:43","date_gmt":"2010-11-04T09:47:43","guid":{"rendered":"http:\/\/vmdamentals.com\/?p=897"},"modified":"2010-11-30T21:57:18","modified_gmt":"2010-11-30T20:57:18","slug":"raid5-write-performance-revisited","status":"publish","type":"post","link":"https:\/\/www.vmdamentals.com\/?p=897","title":{"rendered":"RAID5 write performance &#8211; Revisited"},"content":{"rendered":"<blockquote><p>In this post: <a href=\"http:\/\/vmdamentals.com\/?p=296\" target=\"_blanc\">Throughput part 2: RAID types and segment sizes<\/a> I wrote that a RAID5 setup can potentially perform better in a heavy-write environment over RAID10, if tunes right. While theoretically this might be true, I have some important addendum&#8217;s to this statement that vote against RAID5 which I&#8217;d like to share.<\/p><\/blockquote>\n<p><!--more--><br \/>\n<BR><BR><br \/>\n<strong>The original idea<\/strong><\/p>\n<p>The original idea was hidden inside the &#8220;write penalty&#8221; of a RAID array. A RAID10 is relatively simple: the Write Penalty is always 2. This is because the way a RAID10 is constructed: It is basically a striped set of mirrors (a RAID0 of several RAID1&#8217;s if you like). So for every segment you write, you need to perform a seek of TWO disks (both disks in a single RAID1 mirror). This makes a RAID10 a simple and high performing setup, especially for heavy writes.<\/p>\n<p>Now we look at RAID5. RAID5 is basically a RAID0 striped set of disks. But since RAID0 will loose ALL of its data is a single member fails, RAID5 adds a parity segment to every stripe set. This will impact writing to a RAID5 array though: If a single segment has to be written (like in the RAID10 example above), the array actually needs to first read that segment, read the parity segment, recalculate the parity, then write both the new segment and the parity back to the two disks. This is commonly called &#8220;read-modify-write&#8221;, and has a write penalty of 4, which is obviously worse than the RAID10 variant.<\/p>\n<p>But potentially a RAID5 set can perform very well when looking at write penalty: If you have an entire stripe to write, you simply calculate the parity, and then proceed to write the ENTIRE stripe in one swift stroke. SANs like EMC&#8217;s CLARiiON actually will try and keep a RAID5 write into its write cache hoping it will gain all segments of a particular stripe so that a full stripe write can be performed. Very smart indeed \ud83d\ude42<\/p>\n<p>Knowing all the things above, I figured you could optimize a RAID5 setup with heavy writes by tuning the segment size: If you were writing mostly 64K blocks on a (4+1) RAID5 set, you could optimize these writes by selecting a segment size of 16KB. This way every 64K write is split up over 4 data segments and a parity segment, effectively performing a full-stripe write on the array for each 64KB write.<br \/>\n<BR><BR><br \/>\n<strong>Where it all falls down<\/strong><\/p>\n<p>This tuning sounds very nice. But I figured out this tuning actually almost never helps! The explanation is simple: In a random-write environment (which virtually every VMware environment is) any full-stripe write would need ALL disks in the RAID5 set to seek to a certain segment. The write after that is very effective though. <\/p>\n<p>Now look at the alternative: let&#8217;s say any random write fits on a single segment (for example use a 64KB segment size; VMware hardly writes block larger than this). Now the array will perform a &#8220;read modify write&#8221;, which causes the array first to read one segment and its parity (only two spindles seek). After a recalculation of the parity, two writes occur (the same two spindles seek to the same cylinder; with a little luck the heads are still around!).<\/p>\n<p>This alternative gets more and more effective as you add more members in the RAID5 set, actually BOOSTING write performance over the &#8220;tuned&#8221; version. The more members in the RAID5 set, the more disks need to seek for each write in the tuned version.<br \/>\n<BR><BR><br \/>\n<strong>Is this RAID5 segment-size tuning never a good idea?<\/strong><\/p>\n<p>In some isolated cases, it might still be effective to tune the segment size of a RAID5 array. Basically writing gets a real boost if you use sequential writing, and the array for some reason is not able to combine these writes into Full Stripe Writes by itself (like EMC&#8217;s CLARiiON does, see above). Tuning the segment size could &#8220;force&#8221; the array to perform Full Stripe Writes in this case, boosting performance by great lengths.<\/p>\n<p>Considering most modern arrays, the chances of RAID5 tuning to be effective are slim at best. Most arrays will not even allow you to adjust the segment size, and even if they do they are most of the time able to tune their writes to Full Stripe Writes internally.<\/p>\n<p>While discussing RAID5 anyway: Do not forget that apart from the write performance, the performance impact when rebuilding a RAID5 array is usually very high. Some arrays (yes the EMC CLARiiON for example) can detect disks which are <em>about<\/em> to fail, and copy their contents off to a hot spare disk before the actual failure occurs. The impact for this action will be much smaller, since only one disk in the array performs a full capacity read, and all other disks can still handle IOPS. Rebuild impact is very much like a RAID10 set in this case. But these &#8220;smart&#8221; rebuilds are not always possible; disks fail, sometimes without notice.<\/p>\n<p>So if you scale a RAID5 set to be able to perform no more IOPS than is required by the workload, a rebuild of that RAID5 set should be noted as <strong>downtime<\/strong>: During a rebuild, all disks in the set perform a full read of their ENTIRE capacity, and the disk being rebuild performs a write of its ENTIRE capacity, heavilly impacting performance for the regular workload. And a full rebuild can go on for hours or even days! <\/p>\n<p><strong><em>So when using RAID5, you should consider two important things: Make sure no heavy writing is going on, or in specific situations: Tune the segment size.. Also think about whether or not you need to size for RAID5-rebuild impact. <\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post: Throughput part 2: RAID types and segment sizes I wrote that a RAID5 setup can potentially perform better in a heavy-write environment over RAID10, if tunes right. While theoretically this might be true, I have some important addendum&#8217;s to this statement that vote against RAID5 which I&#8217;d like to share.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[148,149,146,39,82,143,88,150,145,151,632,147,144],"class_list":["post-897","post","type-post","status-publish","format-standard","hentry","category-vmware","tag-full-stripe","tag-full-stripe-write","tag-impact","tag-performance","tag-raid","tag-raid-5","tag-raid5","tag-read-modify-write","tag-rebuild","tag-rmw","tag-vmware","tag-write-penalty","tag-write-performance"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=897"}],"version-history":[{"count":22,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/897\/revisions"}],"predecessor-version":[{"id":1235,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=\/wp\/v2\/posts\/897\/revisions\/1235"}],"wp:attachment":[{"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vmdamentals.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}