<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tuning on Charlie Chiang's blog</title><link>https://charlie0129.github.io/blog/categories/tuning/</link><description>Recent content in Tuning on Charlie Chiang's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 05 Nov 2024 14:40:00 +0800</lastBuildDate><atom:link href="https://charlie0129.github.io/blog/categories/tuning/index.xml" rel="self" type="application/rss+xml"/><item><title>XFS Tuning for Hardware RAID</title><link>https://charlie0129.github.io/blog/p/xfs-with-hw-raid/</link><pubDate>Tue, 05 Nov 2024 14:40:00 +0800</pubDate><guid>https://charlie0129.github.io/blog/p/xfs-with-hw-raid/</guid><description>&lt;h2 id="stripe-size">Stripe Size
&lt;/h2>&lt;p>When you create an hardware RAID array, you must encountered the term &lt;strong>stripe size&lt;/strong>.&lt;/p>
&lt;p>For example, an 8-disk RAID 1/0 has a &lt;strong>stripe width&lt;/strong> of 4, with a &lt;strong>stripe element size&lt;/strong> of 64 KB has a &lt;strong>stripe size&lt;/strong> of 256 KB (4 * 64 KB). A 5-disk RAID 5 (4+1) with a 64 KB &lt;strong>stripe element size&lt;/strong> also has a &lt;strong>stripe width&lt;/strong> of 256 KB drive (4 * 64 KB) .&lt;/p>
&lt;p>A &lt;strong>stripe&lt;/strong> is the smallest chunk of data within a RAID array that can be addressed. People often also refer to this as granularity or block size. It can be compared to the blocks (logical block addressing - LBA) on conventional hard drives. Most RAID controllers allow the user to define her or his favorite stripe size, because it alters the performance characteristics of a RAID array. &lt;a class="link" href="https://www.tomshardware.com/reviews/RAID-SCALING-CHARTS,1735-4.html" target="_blank" rel="noopener"
>Reference&lt;/a>&lt;/p>
&lt;p>It is important to let the filesystem you use know the underlying RAID array&amp;rsquo;s &lt;strong>stripe size&lt;/strong>. This is because the filesystem will align its data blocks to the RAID array&amp;rsquo;s &lt;strong>stripe size&lt;/strong>. This will help to avoid read-modify-write operations, which can be very slow.&lt;/p>
&lt;p>For example, when creating a Virtual Disk in a Dell PERC H730P Controller, you can see the &lt;strong>stripe element size&lt;/strong>.&lt;/p>
&lt;p>&lt;img src="https://charlie0129.github.io/blog/p/xfs-with-hw-raid/images/h730p-create-vd.png"
width="1020"
height="764"
srcset="https://charlie0129.github.io/blog/p/xfs-with-hw-raid/images/h730p-create-vd_hu_e932e40b4527a18e.webp 480w, https://charlie0129.github.io/blog/p/xfs-with-hw-raid/images/h730p-create-vd_hu_d36f0409f7a5add7.jpg 480w, https://charlie0129.github.io/blog/p/xfs-with-hw-raid/images/h730p-create-vd_hu_66bb4e0f7899a2f6.webp 1020w, https://charlie0129.github.io/blog/p/xfs-with-hw-raid/images/h730p-create-vd_hu_5c24b674b1db5127.jpg 1020w"
loading="lazy"
alt="image-2024110530534764 PM"
class="gallery-image"
data-flex-grow="133"
data-flex-basis="320px"
>
&lt;/p>
&lt;h2 id="tune-xfs-for-hardware-raid">Tune XFS for Hardware RAID
&lt;/h2>&lt;p>When you format the XFS partition, you can tell XFS about the underlying array info.&lt;/p>
&lt;p>For example, I have 4x8T HDDs in RAID 10 with &lt;strong>stripe element size&lt;/strong> of 64 KB. So I have a &lt;strong>stripe width&lt;/strong> of 2 and a &lt;strong>stripe size&lt;/strong> of 128 KB. The corresponding XFS options is &lt;code>sw=2&lt;/code> and &lt;code>su=64k&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">mkfs.xfs -f -d &lt;span class="nv">su&lt;/span>&lt;span class="o">=&lt;/span>64k,sw&lt;span class="o">=&lt;/span>&lt;span class="m">2&lt;/span> /dev/sdb
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="other-resources">Other Resources
&lt;/h2>&lt;ul>
&lt;li>&lt;a class="link" href="https://www.percona.com/blog/aligning-io-on-a-hard-disk-raid-the-theory/" target="_blank" rel="noopener"
>https://www.percona.com/blog/aligning-io-on-a-hard-disk-raid-the-theory/&lt;/a>&lt;/li>
&lt;li>&lt;a class="link" href="https://www.percona.com/blog/setting-up-xfs-the-simple-edition/" target="_blank" rel="noopener"
>https://www.percona.com/blog/setting-up-xfs-the-simple-edition/&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>