<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Louwrentius - Storage</title><link href="https://louwrentius.com/" rel="alternate"/><link href="https://louwrentius.com/feeds/storage.atom.xml" rel="self"/><id>https://louwrentius.com/</id><updated>2023-03-26T12:00:00+02:00</updated><entry><title>Benchmarking cheap SSDs for fun, no profit (be warned)</title><link href="https://louwrentius.com/benchmarking-cheap-ssds-for-fun-no-profit-be-warned.html" rel="alternate"/><published>2023-03-26T12:00:00+02:00</published><updated>2023-03-26T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2023-03-26:/benchmarking-cheap-ssds-for-fun-no-profit-be-warned.html</id><summary type="html">&lt;p&gt;The price of Solid-state drives (SSDs) has dropped significantly over the last few years. It's now possible to buy a 1TB solid-state drive for less than €60. However, at such low price points, there is a catch.&lt;/p&gt;
&lt;p&gt;Although cheap SSDs do perform fine regarding reads, sustained write performance can be …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The price of Solid-state drives (SSDs) has dropped significantly over the last few years. It's now possible to buy a 1TB solid-state drive for less than €60. However, at such low price points, there is a catch.&lt;/p&gt;
&lt;p&gt;Although cheap SSDs do perform fine regarding reads, sustained write performance can be really atrocious. To demonstrate this concept, I bought a bunch of the cheapest SATA SSDs I could find - as listed below - and benchmarked them with &lt;a href="https://fio.readthedocs.io/en/latest/fio_doc.html"&gt;Fio&lt;/a&gt;. &lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Capacity&lt;/th&gt;
&lt;th&gt;Price&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ADATA Ultimate SU650&lt;/td&gt;
&lt;td&gt;240 GB&lt;/td&gt;
&lt;td&gt;€ 15,99&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PNY CS900&lt;/td&gt;
&lt;td&gt;120 GB&lt;/td&gt;
&lt;td&gt;€ 14,56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kingston A400&lt;/td&gt;
&lt;td&gt;120 GB&lt;/td&gt;
&lt;td&gt;€ 20,85&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Verbatim Vi550 S3&lt;/td&gt;
&lt;td&gt;128 GB&lt;/td&gt;
&lt;td&gt;€ 14,99&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I didn't have the budget to buy a bunch of 1TB of 2TB SSD, so these ultra-cheap, low capacity SSDs are a bit of a stand-in. I've also added a Crucial MX500 1TB (CT1000MX500SSD1) SATA&lt;sup id="fnref:sata"&gt;&lt;a class="footnote-ref" href="#fn:sata"&gt;1&lt;/a&gt;&lt;/sup&gt; SSD - which I already owned - to the benchmarks to see how well those small-capacity SSDs stack up to a cheap SSD with a much larger capacity.&lt;/p&gt;
&lt;h3&gt;Understanding SSD write performance&lt;/h3&gt;
&lt;p&gt;To understand the benchmark results a bit better, we discuss some SSD concepts in this section. Feel free to skip to the actual benchmarks if you're already familiar with them.&lt;/p&gt;
&lt;h4&gt;SLC Cache&lt;/h4&gt;
&lt;p&gt;SSDs originally used single-level cell (SLC) flash memory, which can hold a single bit and is the fastest and most reliable flash memory available. Unfortunately, it's also the most expensive. To reduce cost, multi-level cell (MLC) flash was invented, which can hold two bits instead of one, at the cost of speed and longevity&lt;sup id="fnref:longevity"&gt;&lt;a class="footnote-ref" href="#fn:longevity"&gt;2&lt;/a&gt;&lt;/sup&gt;. This is even more so for triple-level cell (TLC) and quad-level cell (QLC) flash memory. All 'cheap' SSDs I benchmark use 3D v-nand&lt;sup id="fnref:vnand"&gt;&lt;a class="footnote-ref" href="#fn:vnand"&gt;3&lt;/a&gt;&lt;/sup&gt; TLC flash memory.&lt;/p&gt;
&lt;p&gt;One technique to temporarily boost SSD performance is to use a (small) portion of (in our case) TLC flash memory as if it was SLC memory. This SLC memory then acts as a fast write cache&lt;sup id="fnref:dynamic"&gt;&lt;a class="footnote-ref" href="#fn:dynamic"&gt;4&lt;/a&gt;&lt;/sup&gt;. When the SSD is idle, data is moved from the SLC cache to the TLC flash memory in the background. However, this process is limited by the speed of the 'slower' TLC flash memory and can take a while to complete.&lt;/p&gt;
&lt;p&gt;While this trick with SLC memory works well for brief, intermittent write loads, sustained write loads will fill up the SLC cache and cause a significant drop in performance as the SSD is forced to write data into slower TLC memory.&lt;/p&gt;
&lt;h4&gt;DRAM cache&lt;/h4&gt;
&lt;p&gt;As flash memory has a limited lifespan and can only take a limited number of writes, a wear-leveling mechanism is used to distribute writes over all cells evenly, regardless of where data is written logically. Keeping track of this mapping between logical and physical 'locations' can be sped up with a DRAM cache (chip) as DRAM tend to be faster than flash memory. In addition, the DRAM can also be used to cache writes, improving performance. Cheap SSDs don't use DRAM cache chips to reduce cost, thus they have to update their data mapping tables in flash memory, which is slower. This can also impact (sustained) write performance. To be frank, I'm not sure how much a lack of DRAM impacts our benchmarks.&lt;/p&gt;
&lt;h3&gt;Benchmark method&lt;/h3&gt;
&lt;p&gt;Before I started benchmarking I submitted a trim command to clear each drive.
Next, I performed a sequential write benchmark of the entire SSD with a block size of 1 megabyte and a queue depth of 32. The benchmark is performed on the 'raw' device, no filesystem is used. I used &lt;a href="https://fio.readthedocs.io/en/latest/fio_doc.html"&gt;Fio&lt;/a&gt; for these benchmarks.&lt;/p&gt;
&lt;h3&gt;Benchmark results&lt;/h3&gt;
&lt;p&gt;The chart below shows write bandwith over time for all tested SSDs. Each drive has been benchmarked in full, but the data is truncated to the first 400 seconds for readability (performance didn't change). The raw &lt;a href="https://fio.readthedocs.io/en/latest/fio_doc.html"&gt;Fio&lt;/a&gt; benchmark data can be found &lt;a href="https://louwrentius.com/files/benchmarkdata.tgz"&gt;here&lt;/a&gt; (.tgz).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/cheapssd01.png"&gt;&lt;img alt="chart" src="https://louwrentius.com/static/images/cheapssd01.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;click for a larger image&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;It's funny to me that some cheap SSDs initially perform way better than the more expensive Crucial 1TB SSD&lt;sup id="fnref:crucial"&gt;&lt;a class="footnote-ref" href="#fn:crucial"&gt;5&lt;/a&gt;&lt;/sup&gt;. As soon as their SLC cache runs out, the Crucial 1TB has the last laugh as it shows best sustained throughput, beating all cheaper drives, but the Kingston A400 comes close. &lt;/p&gt;
&lt;p&gt;Of all the cheap SSDs only the Kingston shows the best sustained write speed at around 100 MB/s and there are no intermittent drops in performance. The ADATA, PNY and Verbatim SSDs show flakey behaviour and basically terrible sustained write performance. But make no mistake, I would not call the performance of the Kingston SSD, nor the Crucial SSD - added as a reference - 'good' by any definition of that word. Even the Kingston can't saturate gigabit Ethernet.&lt;/p&gt;
&lt;p&gt;The bandwidth alone doesn't tell the whole story. The latency or responsiveness of the SSDs is also significantly impacted:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/cheapssd03.png"&gt;&lt;img alt="chart" src="https://louwrentius.com/static/images/cheapssd03.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;click for a larger image&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The Crucial 1TB SSD shows best latency overall, followed by the Kingston SSD. The rest of the cheap SSDs show quite high latency spikes and very high latency overall, even when some of the spikes settle, like for the ADATA SSD. When latency is measured in seconds, things are bad.&lt;/p&gt;
&lt;p&gt;To put things a bit in perspective, let's compare these results to a Toshiba 8 TB 7200 RPM hard drive I had lying around.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/cheapssd02.png"&gt;&lt;img alt="chart" src="https://louwrentius.com/static/images/cheapssd02.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;click for a larger image&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The hard drive shows better write throughput and latency&lt;sup id="fnref:funny"&gt;&lt;a class="footnote-ref" href="#fn:funny"&gt;6&lt;/a&gt;&lt;/sup&gt; as compared to most of the tested SSDs. Yes, except for the initial few minutes where the cheap SSDs tend to be faster (except for the Kingston &amp;amp; Crucial SSDs) but how much does that matter?&lt;/p&gt;
&lt;p&gt;As we've shown the performance of a hard drive to contrast the terrible write performance of the cheap SSDs, it's time to also compare them to a more expensive, higher-tier SSD. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/cheapssd05.png"&gt;&lt;img alt="chart" src="https://louwrentius.com/static/images/cheapssd05.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;click for a larger image&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I've bought this Samsung SSD in 2019 for €137 euro, so that's quite a different price point. I think the graph speaks for itself, especially if you consider that this graph is not truncated, this is the full drive write.&lt;/p&gt;
&lt;h3&gt;Evaluation &amp;amp; conclusion&lt;/h3&gt;
&lt;p&gt;One of the funnier conclusions to draw is that it's beter to use a hard drive than to use cheap SSDs if you need to ingest a lot of data. Even the Crucial 1TB SSD could not keep up with the HDD.&lt;/p&gt;
&lt;p&gt;A more interesting conclusion is that the 1TB SSD didn't perform that much better than the small cheaper SSDs. Or to put it differently: although the performance of the small, cheap SSDs is not representative of the larger SSD, it is still quite in the same ball park. I don't think it's a coincidence that the Kingston SSD came very close to the performance of the Crucial SSD, as it's the most 'expensive' of the cheap drives.&lt;/p&gt;
&lt;p&gt;In the end, my intend was to demonstrate with actual benchmarks how cheap SSDs show bad sustained write performance and I think I succeeded. I hope it helps people to understand that good SSD write performance is not a given, especially for cheaper drives.&lt;/p&gt;
&lt;p&gt;The Hacker News discussion of this blog post can be &lt;a href="https://news.ycombinator.com/item?id=35325883"&gt;found here&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Disclaimer&lt;/h3&gt;
&lt;p&gt;I'm not sponsored in any way. All mentioned products have been bought with my own money.&lt;/p&gt;
&lt;p&gt;The graphs are created with &lt;a href="https://github.com/louwrentius/fio-plot"&gt;fio-plot&lt;/a&gt;, a tool I've made and maintain.
The benchmarks have been performed with bench-fio, a tool included with fio-plot, to automate benchmarking with Fio.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:sata"&gt;
&lt;p&gt;As I don't have a test system with NVMe, I had to use SATA-based SSDs. The fact that the SATA interface was not the limiting factor in any of the tests, is foreboding.&amp;#160;&lt;a class="footnote-backref" href="#fnref:sata" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:longevity"&gt;
&lt;p&gt;As a general note, I think the vast majority of users should not worry about SSD longevity in general. Only people with high-volume write workloads should keep an eye on write endurance of SSD and buy a suitable product.&amp;#160;&lt;a class="footnote-backref" href="#fnref:longevity" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:vnand"&gt;
&lt;p&gt;instead of packing the bits really dense together in a cell horizontally, the bits are stacked vertically, saving horizontal space. This allows for higher data densities in the same footprint.&amp;#160;&lt;a class="footnote-backref" href="#fnref:vnand" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:dynamic"&gt;
&lt;p&gt;Some SSDs have a static SLC cache, but others size the SLC cache in accordance to how full an SSD is. When the SSD starts to fill up, the SLC cache size is reduced.&amp;#160;&lt;a class="footnote-backref" href="#fnref:dynamic" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:crucial"&gt;
&lt;p&gt;After around 45-50 minutes of testing, performance of the Crucial MX 500 also started to drop to around 40 MB/s and fluctuate up and down. &lt;a href="https://louwrentius.com/static/images/cheapssd06.png"&gt;Evidence&lt;/a&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:crucial" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:funny"&gt;
&lt;p&gt;it's so funny to me that a hard drive beats an SSD on latency.&amp;#160;&lt;a class="footnote-backref" href="#fnref:funny" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="storage"/></entry><entry><title>An ode to the 10,000 RPM Western Digital (Veloci)Raptor</title><link href="https://louwrentius.com/an-ode-to-the-10000-rpm-western-digital-velociraptor.html" rel="alternate"/><published>2021-10-30T12:00:00+02:00</published><updated>2021-10-30T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2021-10-30:/an-ode-to-the-10000-rpm-western-digital-velociraptor.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Back in 2004, I visited a now bankrupt Dutch computer store called MyCom&lt;sup id="fnref:bankrupt"&gt;&lt;a class="footnote-ref" href="#fn:bankrupt"&gt;1&lt;/a&gt;&lt;/sup&gt;, located at the Kinkerstraat in Amsterdam. I was there to buy a Western Digital Raptor model WD740, with 74 GB of capacity, running at 10,000 RPM.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/mywd10k_l.jpg"&gt;&lt;img alt="mywd" src="https://louwrentius.com/static/images/10k/mywd10k_s.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I bought this drive, we were still …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Back in 2004, I visited a now bankrupt Dutch computer store called MyCom&lt;sup id="fnref:bankrupt"&gt;&lt;a class="footnote-ref" href="#fn:bankrupt"&gt;1&lt;/a&gt;&lt;/sup&gt;, located at the Kinkerstraat in Amsterdam. I was there to buy a Western Digital Raptor model WD740, with 74 GB of capacity, running at 10,000 RPM.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/mywd10k_l.jpg"&gt;&lt;img alt="mywd" src="https://louwrentius.com/static/images/10k/mywd10k_s.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I bought this drive, we were still in the middle of the transition from the &lt;a href="https://en.wikipedia.org/wiki/Parallel_ATA"&gt;PATA interface&lt;/a&gt; to SATA&lt;sup id="fnref:sata"&gt;&lt;a class="footnote-ref" href="#fn:sata"&gt;2&lt;/a&gt;&lt;/sup&gt;. My raptor hard drive still had a molex connector because older computer power supplies didn't have SATA power connectors.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/mywd10kconnector_l.jpg"&gt;&lt;img alt="olds" src="https://louwrentius.com/static/images/10k/mywd10kconnector_s.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You may notice that I eventually managed to break off the plastic tab of the SATA power connector. Fortunately, I could still power the drive through the Molex connector. &lt;/p&gt;
&lt;p&gt;A later version of the same drive came with the Molex connector disabled, as you can see below.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/wd10knew_l.jpg"&gt;&lt;img alt="news" src="https://louwrentius.com/static/images/10k/wd10knew_s.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Why did the Raptor matter so much?&lt;/h2&gt;
&lt;p&gt;I was very eager to get this drive as it was quite a bit faster than any consumer drive on the market at that time. &lt;/p&gt;
&lt;p&gt;This drive not only made your computer start up faster, but it made it much more responsive. At least, it really felt like that to me at the time.&lt;/p&gt;
&lt;p&gt;The faster spinning drive wasn't so much about more throughput in MB/s - although that improved too - it was all about reduced &lt;em&gt;latency&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;A drive that spins faster&lt;sup id="fnref:hdperf"&gt;&lt;a class="footnote-ref" href="#fn:hdperf"&gt;3&lt;/a&gt;&lt;/sup&gt; can complete more I/O operations per second or IOPs&lt;sup id="fnref:understanding"&gt;&lt;a class="footnote-ref" href="#fn:understanding"&gt;4&lt;/a&gt;&lt;/sup&gt;. It can do more work in the same amount of time, because each operation takes less time, compared to slower turning drives.&lt;/p&gt;
&lt;p&gt;The Raptor - mostly focussed on desktop applications&lt;sup id="fnref:purpose"&gt;&lt;a class="footnote-ref" href="#fn:purpose"&gt;5&lt;/a&gt;&lt;/sup&gt; - brought a lot of relief for professionals and consumer enthusiasts alike. Hard disk performance, notably &lt;em&gt;latency&lt;/em&gt;, was one of the big performance bottlenecks at the time.&lt;/p&gt;
&lt;p&gt;For the vast majority of consumers or employees this bottleneck would start to be alleviated only well after 2010 when SSDs slowly started to become standard in new computers.&lt;/p&gt;
&lt;p&gt;And that's mostly also the point of SSDs: their I/O operations are measured in micro seconds instead of milliseconds. It's not that throughput (MB/s) doesn't matter, but for most interactive applications, you care about latency. That's what makes an old computer feel as new when you swap out the hard drive for an SSD.&lt;/p&gt;
&lt;h2&gt;The Raptor as a boot drive&lt;/h2&gt;
&lt;p&gt;For consumers and enthusiast, the Raptor was an amazing boot drive. The 74 GB model was large enough to hold the operating system and applications. The bulk of the data would still be stored on a second hard drive either also connected through SATA or even still through PATA.&lt;/p&gt;
&lt;p&gt;Running your computer with a Raptor for the boot drive, resulted in lower boot times and application load times. But most of all, the system &lt;em&gt;felt&lt;/em&gt; more responsive.&lt;/p&gt;
&lt;p&gt;And despite the 10,000 RPM speed of the platters, it wasn't that much louder than regular drives at the time.&lt;sup id="fnref:loud"&gt;&lt;a class="footnote-ref" href="#fn:loud"&gt;6&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/M2kAAV_kDH8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;

&lt;p&gt;In the video above, a Raspberry Pi4 boots from a 74 GB Raptor hard drive. &lt;/p&gt;
&lt;h2&gt;Alternatives to the raptor at that time&lt;/h2&gt;
&lt;p&gt;To put things into perspective, 10,000 RPM drives were quite common even in 2003/2004 for usage in servers. The server-oriented drives used the &lt;a href="https://en.wikipedia.org/wiki/Parallel_SCSI"&gt;SCSI&lt;/a&gt; interface/protocol which was incompatible with the on-board IDE/SATA controllers.&lt;/p&gt;
&lt;p&gt;Some enthusiasts - who had the means to do so - did buy both the controller&lt;sup id="fnref:SCSI"&gt;&lt;a class="footnote-ref" href="#fn:SCSI"&gt;7&lt;/a&gt;&lt;/sup&gt; and one or more SCSI 'server' drives to increase the performance of their computer. They could even get 15,000 RPM hard drives! These drives however, were extremely loud and had even less capacity.&lt;/p&gt;
&lt;p&gt;The Raptor did perform remarkably well in almost all circumstances, especially those who mattered to consumers and consumer enthusiasts alike. Suddenly you could get SCSI/Server performance for consumer prices.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://techreport.com/review/6390/western-digitals-raptor-wd740gd-sata-hard-drive/"&gt;in-depth review&lt;/a&gt; of the WD740 by Techreport really shows how significant the raptor was.&lt;/p&gt;
&lt;h2&gt;The Velociraptor&lt;/h2&gt;
&lt;p&gt;The Raptor eventually got replaced with the Velociraptor. The Velociraptor had a 2.5" formfactor, but it was much thicker than a regular 2.5" laptop drive. Because it spun at 10,000 RPM, the drive would get hot and thus it was mounted in an 'icepack' to disipate the generated heat. This gave the Velociraptor a 3.5" formfactor, just like the older Raptor drives.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/velociraptor_l.jpeg"&gt;&lt;img alt="velociraptor" src="https://louwrentius.com/static/images/10k/velociraptor_s.jpeg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the video below, a Raspberry Pi4 boots from a 500 GB Velociraptor hard drive.&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/t6DkOhMr6MY" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen&gt;&lt;/iframe&gt;

&lt;h2&gt;Benchmarking the (Veloci)raptor&lt;/h2&gt;
&lt;p&gt;Hard drives do well with sequential read/write patterns, but their performance implodes when the data access pattern becomes random. This is due to the mechanical nature of the device. That random access pattern is where 10,000 RPM outperform their slower turning siblings. &lt;/p&gt;
&lt;p&gt;Random 4K read performance showing both IOPs and latency. This is kind of a worst-case benchmark to understand the raw I/O and latency performance of a drive. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/10k/compare01_l.png"&gt;&lt;img alt="fios" src="https://louwrentius.com/static/images/10k/compare01_s.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th style="text-align: left;"&gt;Drive ID&lt;/th&gt;
&lt;th&gt;Form Factor&lt;/th&gt;
&lt;th style="text-align: right;"&gt;RPM&lt;/th&gt;
&lt;th style="text-align: right;"&gt;Size (GB)&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;ST9500423AS&lt;/td&gt;
&lt;td&gt;2.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;500&lt;/td&gt;
&lt;td&gt;Seagate laptop hard drive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;WD740GD-75FLA1&lt;/td&gt;
&lt;td&gt;3.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;10,000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;74&lt;/td&gt;
&lt;td&gt;Western Digital Raptor WD740&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;SAMSUNG HD103UJ&lt;/td&gt;
&lt;td&gt;3.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1000&lt;/td&gt;
&lt;td&gt;Samsung Spintpoint F1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;WDC WD5000HHTZ&lt;/td&gt;
&lt;td&gt;2.5" in 3.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;10,000&lt;/td&gt;
&lt;td style="text-align: right;"&gt;500&lt;/td&gt;
&lt;td&gt;Western Digital Velociraptor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;ST2000DM008&lt;/td&gt;
&lt;td&gt;3.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;2000&lt;/td&gt;
&lt;td&gt;Seagate 3.5" 2TB drive&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="text-align: left;"&gt;MB1000GCWCV&lt;/td&gt;
&lt;td&gt;3.5"&lt;/td&gt;
&lt;td style="text-align: right;"&gt;7200&lt;/td&gt;
&lt;td style="text-align: right;"&gt;1000&lt;/td&gt;
&lt;td&gt;HP Branded Seagate 1 TB drive&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I've tested the drives on an IBM M1015 SATA RAID card flashed to IT mode (HBA mode, no RAID firmware). The image is generated with &lt;a href="https://github.com/louwrentius/fio-plot"&gt;fio-plot&lt;/a&gt;, which also comes with a tool to run the &lt;a href="https://github.com/axboe/fio"&gt;fio&lt;/a&gt; benchmarks.&lt;/p&gt;
&lt;p&gt;It is quite clear that both 10,000 RPM drives outperform all 7200 rpm drives, as expected. &lt;/p&gt;
&lt;p&gt;If we compare the original 3.5" Raptor to the 2.5" Velociraptor, the performance increase is significant: 22% more IOPs and 18% lower latency. I think that performance increase is due to a combination of the higher data density, the smaller size (r/w head is faster in the spot it needs to be) and maybe better firmware.&lt;/p&gt;
&lt;p&gt;Both the laptop and desktop Seagate drives seem to be a bit slower than they should be based on theory. The opposite is true for the HP (rebranded Seagate), which seem to perform better than expected for the capacity and rotational speed. I have no idea why that is. I can only speculate that because the HP drive came out of a server, that the fireware was tuned for server usage patterns.&lt;/p&gt;
&lt;h2&gt;Closing words&lt;/h2&gt;
&lt;p&gt;Although the performance increase of the (veloci)raptor was quite significant, it never gained wide-spread adoption. Especially when the Raptor first came to marked, its primary role was that of a boot drive because of its small capacity.
You still needed a second drive for your data. So the increase in performance came at a significant extra cost.&lt;/p&gt;
&lt;p&gt;The Raptor and Velociraptor are now obsolete. You can get a solid state drive for $20 to $40 and even those budget-oriented SSDs will outperform a (Veloci)raptor many times over.&lt;/p&gt;
&lt;p&gt;If you are interested in more pictures and details, take a look at &lt;a href="https://goughlui.com/2017/12/23/tech-flashback-western-digital-raptor-velociraptor-hard-drives/"&gt;this article&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;This article was discussed on Hacker News &lt;a href="https://news.ycombinator.com/item?id=29049423"&gt;here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Reddit thread about this article can be found &lt;a href="https://www.reddit.com/r/hardware/comments/qjpe0o/an_ode_to_the_10000_rpm_western_digital/"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:bankrupt"&gt;
&lt;p&gt;Mycom, a chain store with quite a few shops in all major cities in The Netherlands, went bankrupt &lt;em&gt;twice&lt;/em&gt;, once in 2015 and finally in 2019.&amp;#160;&lt;a class="footnote-backref" href="#fnref:bankrupt" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:sata"&gt;
&lt;p&gt;We are talking about the first SATA version, with a maximum bandwidth capacity of 150 MB/s. Plenty enough for hard drives at that time.&amp;#160;&lt;a class="footnote-backref" href="#fnref:sata" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:hdperf"&gt;
&lt;p&gt;https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics&amp;#160;&lt;a class="footnote-backref" href="#fnref:hdperf" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:understanding"&gt;
&lt;p&gt;https://louwrentius.com/understanding-storage-performance-iops-and-latency.html&amp;#160;&lt;a class="footnote-backref" href="#fnref:understanding" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:purpose"&gt;
&lt;p&gt;&lt;a href="https://www.extremetech.com/computing/55810-review-western-digital-wd740-raptor"&gt;I read&lt;/a&gt; that WD intended the first Raptor (34 GB version) to be used in low-end servers as a cheaper alternative to SCSI drives . After the adoption of the Raptor by computer enthusiasts and professionals, it seems that Western Digital pivoted, so the next version - the 74 GB I have - was geared more towards desktop usage. That also meant that this 74 GB model got fluid bearings, making it quieter&lt;sup id="fnref:quiet"&gt;&lt;a class="footnote-ref" href="#fn:quiet"&gt;8&lt;/a&gt;&lt;/sup&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:purpose" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:loud"&gt;
&lt;p&gt;Please note that the first model, the 37 GB version, used ball bearings in stead of fluid bearings, and was reported to be significant louder.&amp;#160;&lt;a class="footnote-backref" href="#fnref:loud" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:SCSI"&gt;
&lt;p&gt;Low-end SCSI card were often used to power flatbed scanners, Iomega ZIP drives, tape drives or other peripherals, but in order to benefit from the performance of those server hard drives, you needed a SCSI controller supporting higher bandwidth and those were more expensive.&amp;#160;&lt;a class="footnote-backref" href="#fnref:SCSI" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:quiet"&gt;
&lt;p&gt;The 74 GB model is actually rather quiet drive at idle. Drive activity sounds rather smooth and pleasant, no rattling.&amp;#160;&lt;a class="footnote-backref" href="#fnref:quiet" title="Jump back to footnote 8 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="Storage"/></entry><entry><title>Don't be afraid of RAID</title><link href="https://louwrentius.com/dont-be-afraid-of-raid.html" rel="alternate"/><published>2020-05-22T12:00:00+02:00</published><updated>2020-05-22T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-05-22:/dont-be-afraid-of-raid.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I sense this sentiment on the internet that RAID is dangerous, that the likelihood of your RAID array failing during a rebuild is almost a certainty, because hard drives have become so large.&lt;/p&gt;
&lt;p&gt;I think nothing is further from the truth and I would like to dispel this myth …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I sense this sentiment on the internet that RAID is dangerous, that the likelihood of your RAID array failing during a rebuild is almost a certainty, because hard drives have become so large.&lt;/p&gt;
&lt;p&gt;I think nothing is further from the truth and I would like to dispel this myth.&lt;/p&gt;
&lt;p&gt;Especially for home users and small businesses, RAID arrays are still a reliable and efficient way of storing a lot of data in a single place. &lt;/p&gt;
&lt;h2&gt;Perception of RAID reliability&lt;/h2&gt;
&lt;p&gt;There are many horror stories to be found on the internet about people at home losing their RAID array. These stories may have contributed to a negative attitude towards RAID in general. &lt;/p&gt;
&lt;p&gt;You may acuse me of victim blaming, but in many cases, I do wonder if those incidents were due to user error&lt;sup id="fnref:usererror"&gt;&lt;a class="footnote-ref" href="#fn:usererror"&gt;1&lt;/a&gt;&lt;/sup&gt;, due to bad luck or actual RAID causing problems. And there is a bias in reporting: you won't hear from the countless people who have no issues.&lt;/p&gt;
&lt;p&gt;In any case, the damage is done, but I still think (software) RAID is perfectly fine. &lt;/p&gt;
&lt;h2&gt;The myth about the Unrecoverable Read Error (URE)&lt;/h2&gt;
&lt;p&gt;I think the trouble started with this &lt;a href="https://www.zdnet.com/article/why-raid-5-stops-working-in-2009/#"&gt;terrible article on ZDNET&lt;/a&gt; from 2007.&lt;/p&gt;
&lt;p&gt;In this article, it's argued that as drives become bigger, but not more &lt;em&gt;reliable&lt;/em&gt;, you will see more unrecoverable read errors (UREs). More capacity means more sectors, so more risk of one of them going bad.&lt;/p&gt;
&lt;p&gt;An URE is an incident where the hard drive can't read a sector&lt;sup id="fnref:sector"&gt;&lt;a class="footnote-ref" href="#fn:sector"&gt;2&lt;/a&gt;&lt;/sup&gt;. 
For old people like me, that sounds like the definition of a &lt;strong&gt;'bad sector'&lt;/strong&gt;. 
The article argues that on average you would encounter an URE for every 12.5 TB of data read. &lt;/p&gt;
&lt;p&gt;By the logic of the ZDNET acticle, just copying all data from a 14 TB drive would probably be impossible, because you would probably hit an URE / bad sector before you finish your copy.&lt;/p&gt;
&lt;p&gt;This is a very big issue for RAID arrays. A RAID array rebuild consists of reading the contents of all remaining drives in their entirety&lt;sup id="fnref:zfspartial"&gt;&lt;a class="footnote-ref" href="#fn:zfspartial"&gt;3&lt;/a&gt;&lt;/sup&gt;. So you are &lt;em&gt;guaranteed&lt;/em&gt; to hit an URE during a RAID rebuild. &lt;/p&gt;
&lt;p&gt;The good news is that you don't have to worry about any of this. Because it is &lt;em&gt;not true&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Hard drives are not &lt;em&gt;that&lt;/em&gt; unreliable in practice. On the contrary. They are remarkably reliable, I would say. Just look at the &lt;a href="https://www.backblaze.com/blog/backblaze-hard-drive-stats-q1-2020/"&gt;Backblaze drive statistics&lt;/a&gt;&lt;sup id="fnref:dc"&gt;&lt;a class="footnote-ref" href="#fn:dc"&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;The prediction of the infamous ZDNET article has not come true. The URE specification for hard drive describes a worst-case scenario and seem to be more about marketing (a way to differentiate enterprise drives from consumer drives) than about reality.&lt;/p&gt;
&lt;p&gt;If the ZDNET article were true, I, myself, should have encountered many UREs because of the many RAID array scrubs/patrol reads that have completed acros various RAID arrays.&lt;/p&gt;
&lt;p&gt;RAID has never stopped working and is still going strong.&lt;/p&gt;
&lt;p&gt;&lt;a class="embedly-card" href="https://www.reddit.com/r/DataHoarder/comments/515l3t/the_hate_raid5_gets_is_uncalled_for/d79xvls"&gt;Card&lt;/a&gt;&lt;/p&gt;
&lt;script async src="//embed.redditmedia.com/widgets/platform.js" charset="UTF-8"&gt;&lt;/script&gt;

&lt;h2&gt;Scrubbing protects against the impact of bad sectors&lt;/h2&gt;
&lt;p&gt;When a drive fails in a RAID array that can only tollerate one drive failure, it's very important that all remaining drives won't encounter any read errors. Because redundancy is lost, any read errors due to bad sectors could mean that the entire array is lost or at least some files are corrupted&lt;sup id="fnref:zfsisbetter"&gt;&lt;a class="footnote-ref" href="#fn:zfsisbetter"&gt;5&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Every RAID array supports 'scrubbing'. It's a process where every sector of the RAID array is read, which in effect causes all sectors of all hard drives to be read. &lt;/p&gt;
&lt;p&gt;A scrub is a process to check for bad sectors in advance. If bad sectors are found on a hard drive, the drive can be replaced so it will not cause problems during a potential future rebuild. Replacing the drive itself will cause a rebuild, but assuming the scrub didn't find any other drives with bad sectors, that rebuild will be fine.&lt;/p&gt;
&lt;p&gt;A RAID array that doesn't undergo a regular scrub is a disaster waiting to happen. Bad sectors may be building up on one of the other drivs and when a drive actually fails, the entire array may be lost because of the undetected bad sectors on (one of) the remaining drives. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;If you want to store data in a reliable way on a RAID array, you need to assure the array is scrubbed periodically.&lt;/em&gt; And even if you don't use RAID, I would recommend running a long SMART test once a month against every hard drive you own.&lt;/p&gt;
&lt;p&gt;By default, a Linux software RAID array is scrubbed once a week on Ubuntu. For details, look at the contents of /etc/cron.d/mdadm.&lt;/p&gt;
&lt;p&gt;If you use ZFS on Linux, your array is automatically scrubbed on the second Sunday of every month if you run Ubuntu.&lt;/p&gt;
&lt;p&gt;NAS vendors like Synology or QNAP have data scrubs enabled by default. Consider the manual of your particular NAS to adjust the frequency. I would recommend to scrub at least once a month and at night. &lt;/p&gt;
&lt;h2&gt;Why is RAID 5 considered harmful?&lt;/h2&gt;
&lt;p&gt;Frankly, &lt;a href="https://louwrentius.com/raid-5-is-perfectly-fine-for-home-usage.html"&gt;I wonder that too&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I notice a lot of people on the internet claiming that you should &lt;em&gt;never&lt;/em&gt; use RAID 5 but I disagree. It all depends on the circumstances. Finding a balance between cost and risk is important.&lt;/p&gt;
&lt;p&gt;This &lt;a href="http://www.baarf.dk"&gt;page dating back to 2003&lt;/a&gt; advocated not to use RAID 5 but that's focused on the enterprise environment and even there I see its uses.&lt;/p&gt;
&lt;p&gt;For &lt;em&gt;small&lt;/em&gt; RAID arrays with five or less drives I think RAID 5 is still a great fit. Especially if you run a small 4-bay NAS it would make total sense to use RAID 5. You get a nice balance between capacity and the cost of availability. &lt;/p&gt;
&lt;p&gt;It's not really recommended to create larger RAID 5 arrays. Compared to a single drive, a RAID array with 8 drives is 8 times more likely to experience a drive failure. You multiply the risk of a single drive failing by eight. With larger arrays, double drive failure becomes a serious risk.&lt;/p&gt;
&lt;p&gt;This is why it's really recommended to use RAID 6 for larger RAID arrays, because RAID 6 can tollerate two simultaneous drive failures. I've used RAID 6 in the past and I use RAIDZ2 (ZFS) as the basis for my current NAS.&lt;/p&gt;
&lt;p&gt;I also run an 8-drive RAID 5 in one of my servers that hosts &lt;em&gt;not so important data&lt;/em&gt; that I still want to keep around and would rather not lose, but not at every cost. It's all about a balance between risk and cost. Please also read the postscript of this post, you will like it.&lt;/p&gt;
&lt;p&gt;It is true that during a rebuild, hard drives are strained more, but unless the RAID array is also in heavy use, the load on the drive isn't that big: the data is read sequentially, which is quite easy on the drives.&lt;/p&gt;
&lt;p&gt;RAID &lt;em&gt;rebuild performance&lt;/em&gt; is mostly determined by the size of the drives and not by the number of drives in the RAID array&lt;sup id="fnref:zfsslow"&gt;&lt;a class="footnote-ref" href="#fn:zfsslow"&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Years ago I ran a 20-drive RAID 6 based on 1 TB drives and it did a rebuild in 5 hours. Recently I tested a rebuild of 8 drives in RAID 5 (using the same drives) and it also took almost 5 hours (4H45M). &lt;/p&gt;
&lt;h2&gt;The RAID write hole&lt;/h2&gt;
&lt;p&gt;The RAID 5/6 'write hole' is often mentioned as something you should be afraid about. &lt;/p&gt;
&lt;p&gt;Parity-based RAID like RAID 5 and RAID 6 may be affected by an issue called the '&lt;a href="https://serverfault.com/questions/844791/write-hole-which-raid-levels-are-affected"&gt;write hole&lt;/a&gt;'. To (over)simplify: if a computer would experience a sudden power failure, a write to the RAID array may be interrupted. This could cause a partial write to the RAID array, leaving it in an inconsistent state.&lt;/p&gt;
&lt;p&gt;As a side note, I would always recommend protecting your NAS with a UPS (battery backup) so your server can shut down in a clean way, before power is lost as the battery runs out. &lt;/p&gt;
&lt;p&gt;ZFS RAIDZ is not affected by the 'write hole' issue, because it writes data to a log first before writing it to the actual array&lt;sup id="fnref:performance"&gt;&lt;a class="footnote-ref" href="#fn:performance"&gt;7&lt;/a&gt;&lt;/sup&gt;.  &lt;/p&gt;
&lt;p&gt;Linux MDADM software RAID also is protected against the 'write hole' phenomenon by using a &lt;a href="https://louwrentius.com/the-impact-of-the-mdadm-bitmap-on-raid-performance.html"&gt;bitmap&lt;/a&gt; (which is enabled by default&lt;sup id="fnref2:performance"&gt;&lt;a class="footnote-ref" href="#fn:performance"&gt;7&lt;/a&gt;&lt;/sup&gt;).&lt;/p&gt;
&lt;p&gt;Hardware RAID is also protected against this by using a battery backup for the cache memory. The data in the cache memory is written to disk as soon as the computer is powered back on.&lt;/p&gt;
&lt;h2&gt;Setup alerting if you care about your data&lt;/h2&gt;
&lt;p&gt;I think that a lot of RAID horror stories are due to the fact that people may never notice any problems until it is too late because they never set up any kind of alerting (by email or other).&lt;/p&gt;
&lt;p&gt;Ideally, you would also make sure your system monitors the SMART data of your hard drives and alert when critical numbers start to rise (Reallocated Sector count and Current Pending Sector count).&lt;/p&gt;
&lt;p&gt;This is also a moment of personal reflection. Do you run a RAID array? Did you setup alerting? Or could your RAID array be failing this &lt;em&gt;very moment&lt;/em&gt; and you wouldn't know?&lt;/p&gt;
&lt;p&gt;Anyway: I think a lack of proper alerting is a nice way of getting into trouble with RAID, but that's not on RAID. Any storage solution that is not monitored is just a disaster waiting to happen.&lt;/p&gt;
&lt;h2&gt;Why people choose not to use RAID&lt;/h2&gt;
&lt;p&gt;If a RAID array fails, all data is lost. Some people are not comfortable with this risk. They would rather lose the contents of some drives, but not all of them. &lt;/p&gt;
&lt;p&gt;Solutions like &lt;a href="https://unraid.net"&gt;Unraid&lt;/a&gt; and &lt;a href="https://www.snapraid.it"&gt;SnapRAID&lt;/a&gt; use one or more dedicated hard drives to store redundant (parity) data. The other hard drives are formatted with your filesystem of choice and can be accessed as normal hard drives. Altough I have no experience with this product, &lt;a href="https://stablebit.com/DrivePool/Overview"&gt;StableBit DrivePool&lt;/a&gt; seems to work in a similar manner.&lt;/p&gt;
&lt;p&gt;If you would have six hard drives, thus five data drives and one parity disk, the loss of two drives would result in data loss, as with RAID 5. However, the data on the remaining four drives would still be intact. The data loss is limited to just one drive worth of data.&lt;/p&gt;
&lt;p&gt;The 'all-or-nothing' risk associated with regular software RAID is thus mitigated. I myself don't think those risks aren't that large, but Unraid and snapraid are popular product and I think they are reasonable alternatives. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/trapexit/mergerfs"&gt;Mergerfs&lt;/a&gt; could also be an interesting option, although it only supports mirroring.&lt;/p&gt;
&lt;h2&gt;Backups are still important&lt;/h2&gt;
&lt;p&gt;Storing your data on any kind of RAID array is &lt;em&gt;never&lt;/em&gt; a substitute for a backup. &lt;/p&gt;
&lt;p&gt;You should still copy your data to some other storage if you want to protect your data. You may chose to only make a backup of a subset of all of the data, but at least you take an informed risk.&lt;/p&gt;
&lt;h2&gt;Evaluation&lt;/h2&gt;
&lt;p&gt;I hope I have demonstrated why RAID is still a valid and reliable option for data storage. &lt;/p&gt;
&lt;p&gt;Feel free to share your own views in the comments. &lt;/p&gt;
&lt;h2&gt;P.S.&lt;/h2&gt;
&lt;p&gt;I ran a scrub on my 8-disk RAID 5 array (based on 2 TB drives) as I was writing this article. My servers are only powered on when I need them and while powered off, it's easy for them to miss their periodic scrub window.&lt;/p&gt;
&lt;p&gt;So as to practice what I preach I ran a scrub. Lo and behold, one of the drives was kicked out of my Linux software RAID array. Don't you love the irony?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sd 0:0:4:0: [sde] tag#29 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:4:0: [sde] tag#29 Sense Key : Medium Error [current] 
sd 0:0:4:0: [sde] tag#29 Add. Sense: Unrecovered read error
sd 0:0:4:0: [sde] tag#29 CDB: Read(10) 28 00 9f 42 9e 30 00 04 00 00
print_req_error: critical medium error, dev sde, sector 2671943216
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Followed by:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;md/raid:md6: Disk failure on sde, disabling device.
md/raid:md6: Operation continuing on 7 devices.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The drive was clearly kicked out because the drive encountered bad sectors. A quick check of the SMART data revealed more than 300+ sectors were already remapped, but the data stored in them could not be recovered, causing read errors.&lt;/p&gt;
&lt;p&gt;This drive is clearly done, although it was still operational. &lt;/p&gt;
&lt;p&gt;After swapping this defective drive with a spare replacement, I started the rebuild proces, which took four hours and twenty minutes. My RAID 5 has rebuild and is now perfectly fine.&lt;/p&gt;
&lt;p&gt;If an event like this doesn't drive the point home that scrubs are important, I don't know what will.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:usererror"&gt;
&lt;p&gt;Sometimes I read what hardware people use for storage and I think about this quote by John Glenn: &lt;em&gt;‘I felt exactly how you would feel if you were getting ready to launch and knew you were sitting on top of 2 million parts — all built by the lowest bidder on a government contract.’&lt;/em&gt;&amp;#160;&lt;a class="footnote-backref" href="#fnref:usererror" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:sector"&gt;
&lt;p&gt;The smallest unit of storage a drive can store, often 4K or 512 bytes for older, smaller drives.&amp;#160;&lt;a class="footnote-backref" href="#fnref:sector" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:zfspartial"&gt;
&lt;p&gt;ZFS works differently, it only reads the sectors containing actual data.&amp;#160;&lt;a class="footnote-backref" href="#fnref:zfspartial" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:dc"&gt;
&lt;p&gt;Those hard drive live in a datacenter with a conditioned environment, which you probably don't have at home. But as long as you keep the temperature of hard drive within limits, I don't think it matters that much.&amp;#160;&lt;a class="footnote-backref" href="#fnref:dc" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:zfsisbetter"&gt;
&lt;p&gt;ZFS is both a RAID solution and a filesystem in one and can tell you exactly which file is affected. A nice feature.&amp;#160;&lt;a class="footnote-backref" href="#fnref:zfsisbetter" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:zfsslow"&gt;
&lt;p&gt;ZFS rebuilds or 'resilvers' &lt;a href="https://louwrentius.com/zfs-resilver-performance-of-various-raid-schemas.html"&gt;become slower&lt;/a&gt; as you add more drives to a RAIDZ(2/3) VDEV, it seems. I'm not sure this is still the case with more recent ZFS versions.&amp;#160;&lt;a class="footnote-backref" href="#fnref:zfsslow" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:performance"&gt;
&lt;p&gt;Both ZFS and MDADM will take a performance hit by using a log/bitmap. Both solutions support using an SSD to accelerate the log/bitmap to remove this performance hit. Most home users probably won't need this.&amp;#160;&lt;a class="footnote-backref" href="#fnref:performance" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;a class="footnote-backref" href="#fnref2:performance" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="storage RAID"/></entry><entry><title>What home NAS builders should understand about silent data corruption</title><link href="https://louwrentius.com/what-home-nas-builders-should-understand-about-silent-data-corruption.html" rel="alternate"/><published>2020-04-23T12:00:00+02:00</published><updated>2020-04-23T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-04-23:/what-home-nas-builders-should-understand-about-silent-data-corruption.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When it comes to dealing with storage in a DIY NAS context, two important topics come up:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Unrecoverable read errors (UREs) or what old people like me call 'bad sectors'&lt;/li&gt;
&lt;li&gt;Silent data corruption (data corruption unnoticed by the storage layers)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I get a strong impression that people tend to …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;When it comes to dealing with storage in a DIY NAS context, two important topics come up:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Unrecoverable read errors (UREs) or what old people like me call 'bad sectors'&lt;/li&gt;
&lt;li&gt;Silent data corruption (data corruption unnoticed by the storage layers)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I get a strong impression that people tend to confuse those concepts. However, they often come up when people evaluate their options when they want to buy or  build their own do-it-yourself NAS. &lt;/p&gt;
&lt;p&gt;In this article, I want to make a clear distinction between the two and assess their risk. This may help you evaluating these risks and make an informed decision.&lt;/p&gt;
&lt;h2&gt;Unrecoverable read errors (due to bad sectors)&lt;/h2&gt;
&lt;p&gt;When a hard drive hits a 'bad sector', it means that it can't read the contents of that particular sector anymore. &lt;/p&gt;
&lt;p&gt;If the hard drive is unable to read that data even after multiple attempts, the operating system will return an Unrecoverable Read Error (URE).&lt;/p&gt;
&lt;p&gt;This is an example (on Linux) of a drive experiencing read errors, as pulled from /var/log/syslog (culled a bit for readability):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sd 0:0:0:0: [sda] tag#19 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda] tag#19 Sense Key : Medium Error [current] 
sd 0:0:0:0: [sda] tag#19 Add. Sense: Unrecovered read error
sd 0:0:0:0: [sda] tag#19 CDB: Read(10) 28 00 02 1c 8c 00 00 00 98 00
blk_update_request: critical medium error, dev sda, sector 35425280 op 0x0:(READ)
sd 0:0:0:0: [sda] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda] tag#16 Sense Key : Medium Error [current] 
sd 0:0:0:0: [sda] tag#16 Add. Sense: Unrecovered read error
sd 0:0:0:0: [sda] tag#16 CDB: Read(10) 28 00 02 1c 8d 00 00 00 88 00
blk_update_request: critical medium error, dev sda, sector 35425536 op 0x0:(READ)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If a sector cannot be read, the data stored in that sector is lost. And in my experience, if you encounter a single bad sector, soon, there will be more. So if this happens, it's time to replace the hard drive. &lt;/p&gt;
&lt;p&gt;We use RAID to protect against drive failure. RAID (no matter the implementation) also can deal with 'partial failure' such as a drive encountering bad sectors. &lt;/p&gt;
&lt;p&gt;In a RAID array, a drive encountering unrecoverable read errors is just kicked out of the array, so it doesn't 'hang' or 'stall' the entire RAID array. &lt;/p&gt;
&lt;p&gt;Please note that this behaviour does depend on the particular RAID solution of choice&lt;sup id="fnref:myobservation"&gt;&lt;a class="footnote-ref" href="#fn:myobservation"&gt;1&lt;/a&gt;&lt;/sup&gt;. The point is though that bad sectors or UREs are a common event and RAID solutions can deal with them properly.&lt;/p&gt;
&lt;p&gt;The real problem with bad sectors (resulting in UREs) is that they can remain undiscovered until it is too late. So to uncover them in an early state, it's &lt;em&gt;very important&lt;/em&gt; to run regular data scrubs. I've &lt;a href="https://louwrentius.com/scrub-your-nas-hard-drives-regularly-if-you-care-about-your-data.html"&gt;written an article&lt;/a&gt; specifically about this topic. &lt;/p&gt;
&lt;h2&gt;Silent data corruption&lt;/h2&gt;
&lt;p&gt;An unrecoverable read error means that we can't read (a portion of) a file. Although it is unfortunate - because we better have an &lt;em&gt;intact&lt;/em&gt; backup of that file - we are also fortunate. &lt;/p&gt;
&lt;p&gt;Why are we fortunate?&lt;/p&gt;
&lt;p&gt;We are fortunate because the storage system - the hard drive and in turn the operating system - reported an error. We were able to diagnose the problem an take action. &lt;/p&gt;
&lt;p&gt;But it is possible that bits and bytes get mangled without your hard drive, SATA controller or operating system noticing. Somewhere, somehow, a bit is read or transmitted as a 1 where it should have been a 0. &lt;/p&gt;
&lt;p&gt;This is &lt;em&gt;really bad&lt;/em&gt;, because this &lt;em&gt;data corruption&lt;/em&gt; is &lt;strong&gt;undetected&lt;/strong&gt;, it is '&lt;em&gt;silent&lt;/em&gt;', there is no notification. &lt;/p&gt;
&lt;p&gt;Because imagine what happens: the corrupted file is happily backed up by your backup software, because it's unaware that anything is wrong. And by the time you discover the data corruption, the original pristine file is no longer part of the backup (rotated out). You are left with a lot of backups of a corrupted file. We encounter dataloss.&lt;/p&gt;
&lt;p&gt;This is one of the scariest kinds of data loss. Because it's very difficult to detect. You'll have to constantly calculate the checksum of a file and verify it's still ok. &lt;/p&gt;
&lt;p&gt;And that's - although rather simplified - exactly what &lt;a href="https://en.wikipedia.org/wiki/ZFS"&gt;ZFS&lt;/a&gt; does (amongst many other things). ZFS uses checksums at the block-level and thus assures with every read if the data contained in the block is still valid. ZFS is one of the few file systems that has this very powerfull feature (BTRFS is another example).  &lt;/p&gt;
&lt;p&gt;Regular RAID arrays (be it hardware-based or software-based) cannot detect silent data corruption (although it could be possible with RAID6). So it must be clear that ZFS is capable of protecting against a risk 'regular' RAID cannot cope with. &lt;/p&gt;
&lt;h2&gt;Is silent data corruption a significant threat for home DIY NAS builders?&lt;/h2&gt;
&lt;p&gt;Although silent data corruption is a very scary threat, from what I can tell there is no significant &lt;em&gt;independant&lt;/em&gt; evidence that the risk of &lt;em&gt;silent&lt;/em&gt; data corruption is so high that the &lt;em&gt;average home DIY NAS builder&lt;/em&gt; should take this risk into account&lt;sup id="fnref:notwrong"&gt;&lt;a class="footnote-ref" href="#fn:notwrong"&gt;2&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;Maybe I'm wrong, but I think many people mistakenly confuse UREs or unrecoverable read errors (caused by bad sectors) with &lt;em&gt;silent&lt;/em&gt; data corruption. And I think that's wrong, because there's nothing &lt;em&gt;silent&lt;/em&gt; about an unrecoverable read error.&lt;/p&gt;
&lt;p&gt;The truth is that hard drives are in fact very reliable when it comes to &lt;em&gt;silent&lt;/em&gt; data corruption, because they make heavy use of error detection and correction algoritms. A significant portion of the raw capacity of a hard drive is sacrificed to store redundant information to aid in detecting and correcting data corruption. According to &lt;a href="https://en.wikipedia.org/wiki/Hard_disk_drive#Error_rates_and_handling"&gt;wikipedia&lt;/a&gt;, hard drives used &lt;a href="https://en.wikipedia.org/wiki/Reed–Solomon_error_correction"&gt;Reed-Solomon&lt;/a&gt; error correction in the past and more modern drives use &lt;a href="https://en.wikipedia.org/wiki/Low-density_parity-check_code#Applications_2"&gt;LDPC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;These error correction codes asure data integrity. Although 'soft' read errors may occur, there is enough additional redundant information stored on the hard drive to detect errors and even reconstruct the data (to some extend). Your hard drive handles this all by itself, it's part of normal operation. &lt;/p&gt;
&lt;p&gt;So this is my point: it's important to understand that there is a lot of protection against silent data corruption in a hard drive. The risk of silent data corruption is therefore small&lt;sup id="fnref:memory"&gt;&lt;a class="footnote-ref" href="#fn:memory"&gt;3&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;Sometimes the read data is so garbled that even the error correction codes cannot reconstruct the data as it was originally stored and that's what we then experience as an unrecoverable read error. But the disk notices! And it will report it!. This is not silent at all!&lt;/p&gt;
&lt;p&gt;To really create silent data corruption, something very special need to happen. And to be very clear: &lt;em&gt;such events do happen&lt;/em&gt;. But they are very rare. &lt;/p&gt;
&lt;p&gt;Somehow, a bit must flip and this event is not detected by the error correction algorithm. Maybe the bit flipped in the hard drive cache memory when it was read from the drive. Maybe it flipped during transport over the SATA cable.&lt;/p&gt;
&lt;p&gt;But it's fun to realise that the SATA protocol also has error detection embedded in the protocol for reliable data transmission. It's error detection and correction &lt;em&gt;all the way down&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The risk that &lt;em&gt;silent&lt;/em&gt; data corruption happens is thus very small, especially for home users.&lt;/p&gt;
&lt;p&gt;Again, make no mistake: the risk is real and storage solutions for larger scale storage solutions (SANs / Storage arrays) with hundreds, thousands or tens of thousands of drives do really have to take into account the risk of silent data corruption. At scale, even very small risks become a certainty.&lt;/p&gt;
&lt;p&gt;Enterprise storage solutions often employ their own proprietary solutions to protect against silent data corruption. Although it depend on the particular solution&lt;sup id="fnref:sector"&gt;&lt;a class="footnote-ref" href="#fn:sector"&gt;4&lt;/a&gt;&lt;/sup&gt;, it's often part of the storage array. ZFS was revolutionary because they put the data integrity checking in the filesystem itself.&lt;/p&gt;
&lt;p&gt;So if you think the risk of silent data corruption is still high enough that you should protect yourself against it, I would recommend to consider using &lt;a href="https://louwrentius.com/please-use-zfs-with-ecc-memory.html"&gt;ECC memory&lt;/a&gt;  to protect against corrupted data in memory. To be frank: I consider non-ECC memory a more likely cause of silent data corruption than the storage subsystem, which already employs all these error detection and correction algoritms. Non-ECC memory is totally unprotected.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anekdote&lt;/strong&gt;: I myself run a &lt;a href="https://louwrentius.com/71-tib-diy-nas-based-on-zfs-on-linux.html"&gt;24-drive NAS&lt;/a&gt; based on ZFS and it has been rock-solid for 6 years straight. &lt;/p&gt;
&lt;p&gt;&lt;img alt="mynasimage" src="https://louwrentius.com/static/images/zfsnas01.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;From time to time, I do run disk 'scrubs', which can take quite some time. Although I have many terrabytes of data protected by ZFS, not a single instance of silent data corruption has been detected. And I have performed so many scrubs that I've read more than a &lt;em&gt;petabyte&lt;/em&gt; worth of data. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anekdote&lt;/strong&gt;: Somebody made a mistake and used the &lt;a href="https://changelog.complete.org/archives/9769-silent-data-corruption-is-real"&gt;wrong type of cable&lt;/a&gt; to connect the hard drives to the HBA controller card. This caused actual silent data corruption. Because that person was running ZFS, it was detected so ZFS saved his data. This an example where ZFS did protect a person against silent data corruption.&lt;/p&gt;
&lt;h2&gt;Evaluation&lt;/h2&gt;
&lt;p&gt;I hope that the difference between unrecoverable read errors and silent data corruption is clear and that we should not confuse the two. They have different risk profiles associated with them.&lt;/p&gt;
&lt;p&gt;Furthermore, I have argued that silent data corruption is &lt;em&gt;real&lt;/em&gt; and a serious issue &lt;em&gt;at scale&lt;/em&gt;, and that it is that is dealt with accordingly. &lt;/p&gt;
&lt;p&gt;However, I've also argued that unless you are a home user running a small datacenter inside your basement, the risk of silent data corruption is so small that it is &lt;em&gt;reasonable&lt;/em&gt; to accept the risk as a DIY NAS builder and not seek specific protection against it.&lt;/p&gt;
&lt;p&gt;The decision is up to you. If you want to go with ZFS and protect against silent data corruption, you should also be aware and accept the &lt;a href="https://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html"&gt;cost of ZFS&lt;/a&gt;. I myself have accepted that cost for my own NAS, but it's OK if you don't. If you care about silent data corruption so much, please also consider using &lt;a href="https://louwrentius.com/please-use-zfs-with-ecc-memory.html"&gt;ECC-memory&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But in my opinion, you are &lt;em&gt;not&lt;/em&gt; taking an unreasonable risk if you chose to go with Unraid, Snapraid, Linux kernel RAID, Windows Storage Spaces or maybe other options in the same vein. I would say that this is &lt;em&gt;reasonable&lt;/em&gt; and up to you. &lt;/p&gt;
&lt;p&gt;Remember: the famous vendors of home user NAS boxes all seem to use regular &lt;a href="https://www.synology.com/en-us/knowledgebase/DSM/tutorial/Storage/What_is_Synology_Hybrid_RAID_SHR"&gt;Linux kernel RAID&lt;/a&gt; under the hood. And they seem to think that's fine.&lt;/p&gt;
&lt;p&gt;In the end, what really matters is a solution that suits your needs and also fits your budget and level of expertise. Can you fix problems when something goes wrong?&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:myobservation"&gt;
&lt;p&gt;I've noticed while testing with this particular drive that the drive was not kicked out of the array, and it just kept trying to read, grinding the Linux software RAID array to a halt. Removing the drive from the array fixed this. There is a 'failfast' option that only works with RAID1 or RAID10.&amp;#160;&lt;a class="footnote-backref" href="#fnref:myobservation" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:notwrong"&gt;
&lt;p&gt;I don't want to suggest in any way that it would be &lt;em&gt;wrong&lt;/em&gt; to take silent data corruption into account, but just to say I think it's not mandatory to really fret over it.&amp;#160;&lt;a class="footnote-backref" href="#fnref:notwrong" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:memory"&gt;
&lt;p&gt;The most significant risk is that enterprise grade hard drives use on-board ECC cache memory, whereas consumer drives use &lt;em&gt;non-ECC&lt;/em&gt; cache memory. So silently corrupted data in the cache memory of the drive could be a risk.&amp;#160;&lt;a class="footnote-backref" href="#fnref:memory" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:sector"&gt;
&lt;p&gt;Storage vendors often choose to reformat har drives with larger &lt;a href="https://www.fujitsu.com/downloads/strsys/system/dx_s3_Oracle_Linux_T10_PI_E16G_en_011.pdf"&gt;sector sizes&lt;/a&gt;&lt;sup id="fnref:af2"&gt;&lt;a class="footnote-ref" href="#fn:af2"&gt;5&lt;/a&gt;&lt;/sup&gt;. Those larger sectors then also incorporate additional checksum data to better protect against data corruption or unrecoverable read errors.&amp;#160;&lt;a class="footnote-backref" href="#fnref:sector" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:af2"&gt;
&lt;p&gt;https://www.seagate.com/files/staticfiles/docs/pdf/whitepaper/safeguarding-data-from-corruption-technology-paper-tp621us.pdf&amp;#160;&lt;a class="footnote-backref" href="#fnref:af2" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="Storage"/></entry><entry><title>Scrub your NAS hard drives regularly if you care about your data</title><link href="https://louwrentius.com/scrub-your-nas-hard-drives-regularly-if-you-care-about-your-data.html" rel="alternate"/><published>2020-04-22T12:00:00+02:00</published><updated>2020-04-22T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-04-22:/scrub-your-nas-hard-drives-regularly-if-you-care-about-your-data.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Lots of people run a NAS at home. Maybe it's a &lt;a href="https://en.wikipedia.org/wiki/Commercial_off-the-shelf"&gt;COTS&lt;/a&gt; device from one of the well-known vendors&lt;sup id="fnref:vendors"&gt;&lt;a class="footnote-ref" href="#fn:vendors"&gt;1&lt;/a&gt;&lt;/sup&gt;, or it's a custom build solution (DIY&lt;sup id="fnref:diy"&gt;&lt;a class="footnote-ref" href="#fn:diy"&gt;2&lt;/a&gt;&lt;/sup&gt;) based on hardware you bought and assembled yourself. &lt;/p&gt;
&lt;p&gt;Buying or building a NAS is one thing, but operating it in a …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Lots of people run a NAS at home. Maybe it's a &lt;a href="https://en.wikipedia.org/wiki/Commercial_off-the-shelf"&gt;COTS&lt;/a&gt; device from one of the well-known vendors&lt;sup id="fnref:vendors"&gt;&lt;a class="footnote-ref" href="#fn:vendors"&gt;1&lt;/a&gt;&lt;/sup&gt;, or it's a custom build solution (DIY&lt;sup id="fnref:diy"&gt;&lt;a class="footnote-ref" href="#fn:diy"&gt;2&lt;/a&gt;&lt;/sup&gt;) based on hardware you bought and assembled yourself. &lt;/p&gt;
&lt;p&gt;Buying or building a NAS is one thing, but operating it in a way that assures that you won't lose data is something else. &lt;/p&gt;
&lt;p&gt;Obviously, the best way to protect against dataloss, is to make regular backups. So ideally, even if the NAS would go up in flames, you would still have your data. &lt;/p&gt;
&lt;p&gt;Since backup storage costs money, people make tradeoffs. They may decide to take the risk and only backup a small portion of the really important data and &lt;a href="https://www.reddit.com/r/DataHoarder/comments/g4wfke/moment_of_silence_for_1_petabyte_data_loss/?utm_source=share&amp;amp;utm_medium=web2x"&gt;take their chances&lt;/a&gt; with the rest. &lt;/p&gt;
&lt;p&gt;Well that is their own right. But still, it would be nice if we would reduce the risk of dataloss to a minimum.&lt;/p&gt;
&lt;h2&gt;The risk: bad sectors&lt;/h2&gt;
&lt;p&gt;The problem is that hard drives may develop &lt;em&gt;bad sectors&lt;/em&gt; over time. Bad sectors are tiny portions of the drive that have become unreadable&lt;sup id="fnref:ure"&gt;&lt;a class="footnote-ref" href="#fn:ure"&gt;3&lt;/a&gt;&lt;/sup&gt;. How small a sector may be, if any data is stored in them, it is now lost and this could cause data corruption (one or more corrupt files).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This is the thing:&lt;/em&gt; those bad sectors may never be discovered until it is too late!&lt;/p&gt;
&lt;p&gt;With todays 14+ TB hard drives, it's easy to store vast amounts of data. Most of that data is probably not frequently accessed, especially at home. &lt;/p&gt;
&lt;p&gt;One or more of your hard drives may be developing bad sectors and you wouldn't even know it. How would you? &lt;/p&gt;
&lt;p&gt;Your data might be at risk right at this moment while you are reading this article. &lt;/p&gt;
&lt;p&gt;A well-known disaster scenario in which people tend to lose data is double hard drive failure where only one drive faillure can be tolerated (RAID 1 (mirror) or RAID 5, and in &lt;em&gt;some&lt;/em&gt; scenario's RAID 10).&lt;/p&gt;
&lt;p&gt;In this scenario, a hard drive in their RAID array has failed and a second drive (one of the remaining good drives) has developed bad sectors. That means effectively a second drive has failed although the drive may still seem operational. Due to the bad sectors, data required to rebuild the array is lost because there is no longer any redundancy&lt;sup id="fnref:zfs"&gt;&lt;a class="footnote-ref" href="#fn:zfs"&gt;4&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;If you run a (variant of) RAID 5, you can only lose a single disk, so if a second disk fails, you lose all data&lt;sup id="fnref:raid6"&gt;&lt;a class="footnote-ref" href="#fn:raid6"&gt;5&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;h2&gt;The mitigation: periodic scrubbing / checking of your disks&lt;/h2&gt;
&lt;p&gt;The only way to find out if a disk has developed bad sectors is to just read them all. Yes: &lt;em&gt;all the sectors&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Checking your hard drives for bad sectors (or other issues) is called 'data scrubbing'. If you bought a NAS from QNAP, Synology or another vendor, there is a menu which allows you to control how often and when you want to perform a data scrub. &lt;/p&gt;
&lt;p&gt;RAID solutions are perfectly capable of handling bad sectors. For a RAID array, it's just equivalent to a failed drive and an affected drive will be kicked out of the RAID array if bad sectors start causing read errors. The big issue we want to prevent is that multiple drives start to develop bad sectors at the same time, because that is the equivalent of multiple simultaneous drive failures, which many RAID arrays can't recover from.&lt;/p&gt;
&lt;p&gt;For home users I would recommend checking all hard drives once a month. I would recommend configuring the data scrub to run at night (often the default) because a scrub may impact performance in a way that can be noticeable and even inconvenient. &lt;/p&gt;
&lt;p&gt;Your vendor may have already configured a default schedule for data scrubs, so you may have been protected all along. If you take a look, at least you know.&lt;/p&gt;
&lt;p&gt;People who have built a DIY NAS have to setup and configure periodic scrubs themselves or they won't happen at all. However, that's not entirely true: I've noticed that on Ubuntu, all Linux software RAID arrays (MDADM) are checked once a month at night. So if you use Linux software RAID you may already be scrubbing.&lt;/p&gt;
&lt;p&gt;A drive that develops bad sectors should be replaced as soon as possible. It should no longer be trusted. The goal of scrubbing is to identify these drives as soon as possible. You don't want to get in a position that multiple drives have started developing bad sectors. You can only prevent that risk by scanning for bad sectors periodically and replacing bad drives. &lt;/p&gt;
&lt;p&gt;You should not be afraid about having to spend a ton of money replacing drives all the time. Bad sectors are not &lt;em&gt;that&lt;/em&gt; common. But they are a common enough that you should check for them. There is a reason why NAS vendors offer the option to run data scrubs and recommend them&lt;sup id="fnref:enterprise"&gt;&lt;a class="footnote-ref" href="#fn:enterprise"&gt;6&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;h2&gt;You probably forgot to configure email alerting&lt;/h2&gt;
&lt;p&gt;If a disk in your NAS would fail, how would you know? If the scrub would discover bad sectors, would you ever notice&lt;sup id="fnref:smallc"&gt;&lt;a class="footnote-ref" href="#fn:smallc"&gt;7&lt;/a&gt;&lt;/sup&gt;?&lt;/p&gt;
&lt;p&gt;The answer may be: only when it's too late. Maybe a drive already failed and you haven't even noticed yet!&lt;/p&gt;
&lt;p&gt;When you've finished reading this article, it may be the right moment to take some time to check the status of your NAS and &lt;em&gt;configure email alerting&lt;/em&gt; (or any other alerting mechanism that works for you). Make your NAS sends out a test message just to confirm it actually works!&lt;/p&gt;
&lt;h2&gt;Closing words&lt;/h2&gt;
&lt;p&gt;So I would like to advice you to do two things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure your NAS runs a data scrub once a month&lt;/li&gt;
&lt;li&gt;Make sure your NAS is able to email alerts about failed disks or scrubs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These actions allow you to fix problems before they become catastrophic. &lt;/p&gt;
&lt;h2&gt;P.S. S.M.A.R.T. monitoring&lt;/h2&gt;
&lt;p&gt;Hard drives have a build-in monitoring system called &lt;a href="https://en.wikipedia.org/wiki/S.M.A.R.T."&gt;S.M.A.R.T.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you have a NAS from one of the NAS vendors, they will allert on SMART monitoring information that would indicate that a drive is failing. DIY builders may have to spend time setting up this kind of monitoring manually. &lt;/p&gt;
&lt;p&gt;For more information about SMART I would recommend [this][this article] and &lt;a href="https://harddrivegeek.com/current-pending-sector-count/"&gt;this one&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://harddrivegeek.com/current-pending-sector-count/"&gt;this article&lt;/a&gt; and also &lt;a href="https://harddrivegeek.com/reallocated-sector-count/"&gt;this one&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Linux users can take a look at the SMART status of their hard drives with &lt;a href="https://github.com/louwrentius/showtools"&gt;this tool&lt;/a&gt; (which I made).&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:vendors"&gt;
&lt;p&gt;QNAP, Synology, Netgear, Buffalo, Thecus, Western Digital, and so on.&amp;#160;&lt;a class="footnote-backref" href="#fnref:vendors" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:diy"&gt;
&lt;p&gt;FreeNAS, Unraid, Windows/Linux with Snapraid, OpenMediaVault, or a custom solution, and so on.&amp;#160;&lt;a class="footnote-backref" href="#fnref:diy" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:ure"&gt;
&lt;p&gt;Bad sectors cause 'unrecoverable read errors' or UREs. Bad sectors have nothing to do with 'silent data corruption'. There's nothing silent about unrecoverable read errors. Hard drives report read errors back to the operating system, they won't go unnoticed.&amp;#160;&lt;a class="footnote-backref" href="#fnref:ure" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:zfs"&gt;
&lt;p&gt;A DIY NAS based on ZFS (FreeNAS is based on ZFS) may help mitigate the impact of such an event. ZFS can continue reading data from the remaining drives, even if bad sectors are encountered. Some files will be corrupted, but most of the data would still be readable. I think this capability is by itself not enough reason to pick a NAS based on ZFS because ZFS also has a cost involved that you need to accept too. For my &lt;a href="https://louwrentius.com/71-tib-diy-nas-based-on-zfs-on-linux.html"&gt;large NAS&lt;/a&gt; I have chosen ZFS because I was prepared to 'pay the cost'.&amp;#160;&lt;a class="footnote-backref" href="#fnref:zfs" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:raid6"&gt;
&lt;p&gt;Some people may chose to go with RAID 6 which tolerates two simultaneous drive failures but they also tend to run larger arrays with more drives, which also increases the risk of drive failure or one of the drives developing bad sectors.&amp;#160;&lt;a class="footnote-backref" href="#fnref:raid6" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:enterprise"&gt;
&lt;p&gt;Enterprise storage solutions (Even entry level storage arrays) often run patrol reads both on individual hard drives and also the RAID arrays on top of them. They are also enabled by default.&amp;#160;&lt;a class="footnote-backref" href="#fnref:enterprise" title="Jump back to footnote 6 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:smallc"&gt;
&lt;p&gt;At one time I worked for a small company that ran their own (single) email server. One of the system administrators discovered totally by accident that one of the two drives in a RAID 1 had failed. It turns out we were running on a &lt;em&gt;single&lt;/em&gt; drive for months before we discovered it, because we forgot to setup email alerting. We didn't lose data, but we came close.&amp;#160;&lt;a class="footnote-backref" href="#fnref:smallc" title="Jump back to footnote 7 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="Storage"/></entry><entry><title>Benchmarking storage with Fio and generating charts of the results</title><link href="https://louwrentius.com/benchmarking-storage-with-fio-and-generating-charts-of-the-results.html" rel="alternate"/><published>2020-04-21T12:00:00+02:00</published><updated>2020-04-21T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-04-21:/benchmarking-storage-with-fio-and-generating-charts-of-the-results.html</id><summary type="html">&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/axboe/fio"&gt;Fio&lt;/a&gt; is a widely-used tool for performing storage benchmarks. Fio offers a lot of options to create a storage benchmark that would best reflect your needs. Fio allows you to assess if your storage solution is up to its task and how much headroom it has. &lt;/p&gt;
&lt;p&gt;Fio outputs &lt;em&gt;.json …&lt;/em&gt;&lt;/p&gt;</summary><content type="html">&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/axboe/fio"&gt;Fio&lt;/a&gt; is a widely-used tool for performing storage benchmarks. Fio offers a lot of options to create a storage benchmark that would best reflect your needs. Fio allows you to assess if your storage solution is up to its task and how much headroom it has. &lt;/p&gt;
&lt;p&gt;Fio outputs &lt;em&gt;.json&lt;/em&gt; and &lt;em&gt;.log&lt;/em&gt; files that need further processing if you would like to make nice charts. Charts may help better communicate your test results to other people. &lt;/p&gt;
&lt;p&gt;To make graphs of Fio benchmark data, I've created &lt;a href="https://github.com/louwrentius/fio-plot"&gt;fio-plot&lt;/a&gt;. With fio-plot you can generate charts like:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/comparingraid10raid5new.png"&gt;&lt;img alt="example1" src="https://louwrentius.com/static/images/comparingraid10raid5new.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/3d_RAID5_10K_NOBITMAP.png"&gt;&lt;img alt="example2" src="https://louwrentius.com/static/images/3d_RAID5_10K_NOBITMAP.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/impactofqueuedepth.png"&gt;&lt;img alt="example3" src="https://louwrentius.com/static/images/impactofqueuedepth.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It's very common that you want to run multiple benchmarks with different parameters to compare results. To generate the data of the charts, many benchmarks need to be run. This process needs to be automated.&lt;/p&gt;
&lt;h3&gt;Automating Fio benchmarks&lt;/h3&gt;
&lt;p&gt;I've chosen to build my own tool to automate Fio benchmarking. This tool is called &lt;a href="https://github.com/louwrentius/fio-plot/tree/master/benchmark_script"&gt;bench_fio&lt;/a&gt; and is part of &lt;a href="https://github.com/louwrentius/fio-plot"&gt;fio-plot&lt;/a&gt;. I'm aware that - as part of fio - a tool called &lt;a href="https://github.com/axboe/fio/blob/master/tools/genfio"&gt;genfio&lt;/a&gt; is provided, to generate fio job files with multiple benchmarks. It's up to you what you want to use. Bench-fio is tailored to output data in a way that aligns with fio-plot.&lt;/p&gt;
&lt;p&gt;Bench-fio allows you to benchmark loads with different iodepths, simultaneous jobs, block sizes and other parameters. A benchmark run can consist of hundreds of tests and take many hours. &lt;/p&gt;
&lt;p&gt;When you run bench_fio, you can expect output like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;████████████████████████████████████████████████████
    +++ Fio Benchmark Script +++

Job template:                  fio-job-template.fio
I/O Engine:                    libaio
Number of benchmarks:          98
Estimated duration:            1:38:00
Devices to be tested:          /dev/md0
Test mode (read/write):        randrw
IOdepth to be tested:          1 2 4 8 16 32 64
NumJobs to be tested:          1 2 4 8 16 32 64
Blocksize(s) to be tested:     4k
Time per test (s):             60
Mixed workload (% Read):       75 90

████████████████████████████████████████████████████
4% |█                        | - [0:04:02, 1:35:00]-]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Bench-fio runs real-time and shows the expected remaining time. It also shows all relevant parameters that have been configured for this benchmark run. This makes it easier to spot any mis-configurations.&lt;/p&gt;
&lt;p&gt;Notice that this benchmark consists of 98 individual tests: iodepth x NumJobs x Mixed Workload parameters (7 x 7 x 2). With a standard of 60 seconds per benchmark &lt;/p&gt;
&lt;p&gt;This is an example of the command-line syntax: 
    :::text 
    ./bench_fio --target /dev/md0 -t device --mode randrw -o RAID_ARRAY --readmix 75 90&lt;/p&gt;
&lt;p&gt;More examples can be found &lt;a href="https://github.com/louwrentius/fio-plot/blob/master/benchmark_script/README.md"&gt;here&lt;/a&gt;.&lt;/p&gt;</content><category term="Storage"/><category term="Fio"/></entry><entry><title>The impact of the MDADM bitmap on RAID performance</title><link href="https://louwrentius.com/the-impact-of-the-mdadm-bitmap-on-raid-performance.html" rel="alternate"/><published>2020-04-06T12:00:00+02:00</published><updated>2020-04-06T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-04-06:/the-impact-of-the-mdadm-bitmap-on-raid-performance.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I'm aware that most people with intensive storage workloads won't run those workloads on hard drives anymore, that ship has sailed a long time ago. SSDs have taken their place (or 'the cloud').&lt;/p&gt;
&lt;p&gt;For those few left who do use hard drives in Linux software RAID setups and run …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I'm aware that most people with intensive storage workloads won't run those workloads on hard drives anymore, that ship has sailed a long time ago. SSDs have taken their place (or 'the cloud').&lt;/p&gt;
&lt;p&gt;For those few left who do use hard drives in Linux software RAID setups and run workloads that generate a lot of random IOPS, this may still be relevant. &lt;/p&gt;
&lt;p&gt;I'm not sure how much a bitmap affects MDADM software RAID arrays based on solid state drives as I have not tested them.&lt;/p&gt;
&lt;h2&gt;The purpose of the bitmap&lt;/h2&gt;
&lt;p&gt;By default, when you create a new software RAID array with MDADM, a bitmap is also configured. The &lt;a href="https://louwrentius.com/speeding-up-linux-mdadm-raid-array-rebuild-time-using-bitmaps.html"&gt;purpose of the bitmap&lt;/a&gt; is to speed up recovery of your RAID array in case the array gets out of sync. &lt;/p&gt;
&lt;p&gt;A bitmap won't help speed up the recovery from drive failure, but the RAID array can get out of sync due to a hard reset or power failure during write operations.&lt;/p&gt;
&lt;h2&gt;The performance impact&lt;/h2&gt;
&lt;p&gt;During some benchmarking of various RAID arrays, I noticed very bad &lt;em&gt;random write&lt;/em&gt; IOPS performance. No matter what the test conditions were, I got the random write performance of a single drive, although the RAID array should perform better. &lt;/p&gt;
&lt;p&gt;Then I noticed that the array was configured with a bitmap. Just for testing purposes, I removed the bitmap all together with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mdadm --grow --bitmap=none /dev/md0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Random write IOPs figures improved immediately. &lt;a href="http://manpages.ubuntu.com/manpages/eoan/en/man8/mdadm.8.html"&gt;This resource&lt;/a&gt; explains why:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;If  the  word internal is given, then the bitmap is stored with the metadata
on the array, and so is replicated on all devices.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So when you write data to our RAID array, the bitmap is also constantly updated. Since that bitmap lives on each drive in the array, it's probably obvious that this really deteriorates random write IOPS.&lt;/p&gt;
&lt;h2&gt;Some examples of the performance impact&lt;/h2&gt;
&lt;h3&gt;Bitmap disabled&lt;/h3&gt;
&lt;p&gt;An example of a RAID 5 array with 8 x 7200 RPM drives. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/3d_RAID5_NOBITMAP.png"&gt;&lt;img alt="nobitmap" src="https://louwrentius.com/static/images/3d_RAID5_NOBITMAP.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Another example with 10.000 RPM drives:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/3d_RAID5_10K_NOBITMAP.png"&gt;&lt;img alt="10knobitmap" src="https://louwrentius.com/static/images/3d_RAID5_10K_NOBITMAP.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Bitmap enabled (internal)&lt;/h3&gt;
&lt;p&gt;We observe significant lower random write IOPs performance overall: &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/3d_RAID5_WITHBITMAP.png"&gt;&lt;img alt="bitmapenabled" src="https://louwrentius.com/static/images/3d_RAID5_WITHBITMAP.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Which is also true for 10.000 RPM drives.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/3d_RAID5_10K_BITMAP.png"&gt;&lt;img alt="10kbitmap" src="https://louwrentius.com/static/images/3d_RAID5_10K_BITMAP.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;External bitmap&lt;/h2&gt;
&lt;p&gt;You could keep the bitmap and still get great random write IOPS by putting the bitmap on a separate SSD. Since my boot device is an SSD, I tested this option like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mdadm --grow --bitmap=/raidbitmap /dev/md0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I noticed excellent random write IOPS &lt;em&gt;with&lt;/em&gt; this external bitmap, similar to running without a bitmap at all. An external bitmap has it's own risks and caveats, so make sure it really fits your needs.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Note: external bitmaps are only known to work on ext2  and  ext3. 
Storing bitmap files on other filesystems may result in serious problems.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;For home users who build DIY NAS servers and who do run MDADM RAID arrays, I would recommend leaving the bitmap &lt;em&gt;enabled&lt;/em&gt;. The impact on sequential file transfers is negligible and the benefit of a quick RAID resync is very obvious.&lt;/p&gt;
&lt;p&gt;Only if you have a workload that would cause a ton of random writes on your storage server would I consider disabling the bitmap. An example of such a use case would be running virtual machines with a heavy write workload.&lt;/p&gt;
&lt;h2&gt;Update on bitmap-chunks&lt;/h2&gt;
&lt;p&gt;Based on feedback in the comments, I've performed a benchmark on a new RAID 5 array setting the --bitmap-chunk option to 128M (Default is 64M). &lt;/p&gt;
&lt;p&gt;The results seem to be significantly &lt;em&gt;worse&lt;/em&gt; than the default for random write IOPS performance. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/3D_RAID5_BITMAPCHUNK_128M.png"&gt;&lt;img alt="bitmapenabled128" src="https://louwrentius.com/static/images/3D_RAID5_BITMAPCHUNK_128M.png" /&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="Storage"/><category term="mdadm"/></entry><entry><title>Understanding Storage Performance - IOPS and Latency</title><link href="https://louwrentius.com/understanding-storage-performance-iops-and-latency.html" rel="alternate"/><published>2020-03-21T12:00:00+01:00</published><updated>2020-03-21T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-03-21:/understanding-storage-performance-iops-and-latency.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;The goal of this blogpost is to help you better understand storage performance. I want to discuss some fundamentals that are true regardless of your particular needs. &lt;/p&gt;
&lt;p&gt;This will help you better reason about storage and may provide a scaffolding for further learning. &lt;/p&gt;
&lt;p&gt;If you run your applications / workloads …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;The goal of this blogpost is to help you better understand storage performance. I want to discuss some fundamentals that are true regardless of your particular needs. &lt;/p&gt;
&lt;p&gt;This will help you better reason about storage and may provide a scaffolding for further learning. &lt;/p&gt;
&lt;p&gt;If you run your applications / workloads entirely in the cloud, this information may feel antiquated or irrelevant.&lt;/p&gt;
&lt;p&gt;However, since the cloud is just somebody else's compute and storage, knowledge about storage may still be relevant. Cloud providers expose storage performance metrics for you to monitor and this may help to make sense of them.&lt;/p&gt;
&lt;h2&gt;Concepts&lt;/h2&gt;
&lt;h3&gt;I/O&lt;/h3&gt;
&lt;p&gt;An I/O is a single read/write request. That I/O is issued to a storage medium (like a hard drive or solid state drive). &lt;/p&gt;
&lt;p&gt;It can be a request to read a particular file from disk. Or it can be a request to write some data to an existing file. Reading or writing a file can result in multiple I/O requests. &lt;/p&gt;
&lt;h3&gt;I/O Request Size&lt;/h3&gt;
&lt;p&gt;The I/O request has a size. The request can be small (like 1 Kilobyte) or large (several megabytes). Different application workloads will issue I/O operations with different request sizes. The I/O request size can impact latency and IOPS figures (two metrics we will discuss shortly).&lt;/p&gt;
&lt;h3&gt;IOPS&lt;/h3&gt;
&lt;p&gt;IOPS stands for I/O Operations Per Second. It is a performance metric that is used (and abused) a lot in the world of storage. It tells us how many I/O requests per second can be handled by the storage (for a particular workload). &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Warning:&lt;/em&gt; this metric is meaningless without a latency figure. We will discuss latency shortly. &lt;/p&gt;
&lt;h3&gt;Bandwidth or throughput&lt;/h3&gt;
&lt;p&gt;If you multiply the IOPS figure with the (average) I/O request size, you get the bandwidth or throughput. We state storage bandwidth mostly in Megabytes and Gigabytes per second.&lt;/p&gt;
&lt;p&gt;To give you an example: if we issue a workload of 1000 IOPS with a request size of 4 Kilobytes, we will get a throughput of 1000 x 4 KB = 4000 KB. This is about ~4 Megabytes per second.&lt;/p&gt;
&lt;h3&gt;Latency&lt;/h3&gt;
&lt;p&gt;Latency is the time it takes for the I/O request to be completed. We start our measurement from the moment the request is issued to the storage layer and stop measuring when either we get the requested data, or get confirmation that the data is stored on disk.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Latency is the single most important metric to focus on when it comes to storage performance, under most circumstances.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;For hard drives, an average latency somewhere between 10 to 20 ms is considered acceptable (20 ms is the upper limit).&lt;/p&gt;
&lt;p&gt;For solid state drives, depending on the workload it should never reach higher than 1-3 ms. In most cases, workloads will experience  less than 1ms latency numbers.&lt;/p&gt;
&lt;h3&gt;IOPS and Latency&lt;/h3&gt;
&lt;p&gt;This is a very important concept to understand. &lt;strong&gt;The IOPS metric is &lt;a href="http://recoverymonkey.org/2012/07/26/an-explanation-of-iops-and-latency/"&gt;meaningless without a statement about latency&lt;/a&gt;&lt;/strong&gt;. You must understand how long each I/O operation will take because latency dictates the responsiveness of individual I/O operations. &lt;/p&gt;
&lt;p&gt;If a storage solution can reach 10,000 IOPS but only at an average latency of 50 ms that could result in very bad application performance. If we want to hit an upper latency target of 10 ms the storage solution may only be capable of 2,000 IOPS.&lt;/p&gt;
&lt;p&gt;For more details on this topic I would recommend &lt;a href="http://blog.richardelling.com/2012/03/iops-and-latency-are-not-related-hdd.html"&gt;this blog&lt;/a&gt; and &lt;a href="http://recoverymonkey.org/2012/07/26/an-explanation-of-iops-and-latency/"&gt;this blog&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Access Patterns&lt;/h3&gt;
&lt;h4&gt;Sequential access&lt;/h4&gt;
&lt;p&gt;An example of a sequential data transfer is copying a large file from one hard drive to another. A large number of sequential (often adjacent) datablocks is read from the source drive and written to another drive. Backup jobs also cause sequential access patterns. &lt;/p&gt;
&lt;p&gt;In practice this access pattern shows the highest possible throughput. &lt;/p&gt;
&lt;p&gt;Hard drives have it easy as they don't have to spend much time moving their read/write heads and can spend most time reading / writing the actual data.&lt;/p&gt;
&lt;h4&gt;Random access&lt;/h4&gt;
&lt;p&gt;I/O requests are issued in a seemingly random pattern to the storage media. The  data could be stored all over various regions on the storage media. An example of such an access pattern is a heavy utilised database server or a virtualisation host running a lot of virtual machines (all operating simultaneously).&lt;/p&gt;
&lt;p&gt;Hard drives will have to spend a lot of time moving their read/write heads and can only spend little time transferring data. Both throughput and IOPS will plummet (as compared to a sequential access pattern).  &lt;/p&gt;
&lt;p&gt;In practice, most common workloads, such as running databases or virtual machines, cause random access patterns on the storage system.&lt;/p&gt;
&lt;h3&gt;Queue depth&lt;/h3&gt;
&lt;p&gt;The queue depth is a number between 1 and ~128 that shows how many I/O requests are queued (in-flight) on average. Having a queue is beneficial as the requests in the queue can be submitted to the storage subsystem in an optimised manner and often in parallel. A queue improves performance at the cost of latency.&lt;/p&gt;
&lt;p&gt;If you have some kind of storage performance monitoring solution in place, a high queue depth could be an indication that the storage subsystem cannot handle the workload. You may also observe higher than normal latency figures. As long as latency figures are still within tolerable limits, there may be no problem.&lt;/p&gt;
&lt;h2&gt;Storage Media Performance characteristics&lt;/h2&gt;
&lt;h3&gt;Hard drives&lt;/h3&gt;
&lt;p&gt;Hard drives &lt;a href="https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics"&gt;(HDDs)&lt;/a&gt; are mechanical devices that resemble a &lt;a href="https://en.wikipedia.org/wiki/File:Portable_78_rpm_record_player.jpg"&gt;record player&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;They have an arm with a read/write head and the data is stored on (multiple) platters. 
&lt;img alt="hd01" src="https://louwrentius.com/static/images/hd01open.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Hard drives have to physically move read/write heads to fulfil read/write requests. This mechanical nature makes them relatively slow as compared to solid state drives (which we will cover shortly). &lt;/p&gt;
&lt;p&gt;Especially random access workloads cause hard drives to spend a lot of time on moving the read/write head to the right position at the right time, so less time is available for actual data transfers.&lt;/p&gt;
&lt;p&gt;The most important thing to know about hard drives is that from a performance perspective (focussing on latency) higher spindle speeds reduce the average latency. &lt;/p&gt;
&lt;table border="0" cellpadding="7" cellspacing="2"&gt;
&lt;tr&gt;&lt;th&gt;Rotational Speed (RPM)&lt;/th&gt;&lt;th&gt;Access Latency(ms)&lt;/th&gt;&lt;th&gt;IOPS&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5400 &lt;/td&gt;&lt;td&gt;17-18 &lt;td&gt;50-60&lt;/td&gt;
&lt;tr&gt;&lt;td&gt;7200 &lt;/td&gt;&lt;td&gt;12-13 &lt;td&gt;75-85&lt;/td&gt;
&lt;tr&gt;&lt;td&gt;10,000 &lt;/td&gt;&lt;td&gt;7-8 &lt;td&gt;120-130&lt;/td&gt;
&lt;tr&gt;&lt;td&gt;15,000 &lt;/td&gt;&lt;td&gt;5-6 &lt;td&gt;150-180&lt;/td&gt;
&lt;/table&gt;

&lt;p&gt;Because the latency of individual I/O requests is lower the drives with a higher RPM, you can issue more of such requests in the same amount of time. That's why the IOPS figure also increases.&lt;/p&gt;
&lt;p&gt;Latency and IOPS of an older Western Digital Velociraptor 10,000 RPM drive:&lt;/p&gt;
&lt;p&gt;&lt;img alt="wd01" src="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/WD740GD_74GB_10.000_RPM_2019-11-27_204549.png" /&gt;
&lt;em&gt;Notice the latency and IOPS in the Queue Depth = 1 column.&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="https://mcpmag.com/Articles/2011/05/12/How-to-Speak-SAN-ish.aspx?Page=1"&gt;Source&lt;/a&gt; used to validate my own research.&lt;/p&gt;
&lt;p&gt;Regarding sequential throughput we can state that fairly old hard drives can sustain throughputs of 100-150 megabytes per second. More modern hard drives with higher capacities can often sustain between 200 - 270 megabytes per second. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An important note&lt;/strong&gt;: sequential transfer speeds are not constant and depend on the physical location of the data on the hard drive platters. As a drive fills up, throughput diminishes. &lt;em&gt;Throughput can drop more than fifty percent!&lt;/em&gt; &lt;sup id="fnref:throughput"&gt;&lt;a class="footnote-ref" href="#fn:throughput"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;So if you want to calculate how long it will take to transfer a particular (large) dataset, you need to take this into account. &lt;/p&gt;
&lt;h3&gt;Solid State Drives&lt;/h3&gt;
&lt;p&gt;Solid state drives (SSDs) have no moving parts, they are based on flash memory (chips). SSDs can handle I/O much faster and thus show significantly lower latency. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/ssd01.jpg"&gt;&lt;img alt="ssd001" src="https://louwrentius.com/static/images/ssd01.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Whereas we measure the average I/O latency of HDDs in milliseconds (a thousand of a second) we measure the latency of SSD I/O operations in microseconds (a millionth of a second). &lt;/p&gt;
&lt;p&gt;Because of this reduced latency per I/O request, SSDs outperform HDDs in every conceivable way. Even a cheap consumer SSD can at least sustain about 5000+ IOPS with only a 0.15 millisecond (150 microseconds) latency. That latency is about 40x better than the best latency of an enterprise 15K RPM hard drive.&lt;/p&gt;
&lt;p&gt;Solid state drives can often handle I/O requests in parallel. This means that larger queue depths with more I/O requests in flight can show significantly higher IOPS with a limited (but not insignificant) increase in latency.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/HPDL380H420I/RAID/MX200/randread_iodepth_2019-08-04-20%3A22%3A53_1_iops_latency.png"&gt;&lt;img alt="ssd01" src="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/HPDL380H420I/RAID/MX200/randread_iodepth_2019-08-04-20%3A22%3A53_1_iops_latency.png" /&gt;&lt;/a&gt;
&lt;em&gt;The random I/O performance of an older SATA consumer SSD&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;More modern enterprise SSDs show better latency and IOPS. The SATA interface seems the main bottleneck.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/INTEL-D3-S4610-on-IBM-M1015_2020-01-29_144451.png"&gt;&lt;img alt="ssd02" src="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/INTEL-D3-S4610-on-IBM-M1015_2020-01-29_144451.png" /&gt;&lt;/a&gt;
&lt;em&gt;The random I/O performance of an enterprise SATA SSD&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;SSDs perform better than HDDs across all relevant metrics except price in relation to capacity. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important note:&lt;/strong&gt;  SSDs are &lt;a href="https://en.wikipedia.org/wiki/Solid-state_drive"&gt;not well-suited for archival storage&lt;/a&gt; of data. Data is stored as charges in the chips and those charges can diminish over time. It's expected that even hard drives are better suited for offline archival purposes although the most suitable storage method would probably be &lt;a href="https://en.wikipedia.org/wiki/Linear_Tape-Open"&gt;tape&lt;/a&gt;.&lt;/p&gt;
&lt;h4&gt;SSD actual performance vs advertised performance&lt;/h4&gt;
&lt;p&gt;Many SSDs are advertised with performance figures of 80,000 - 100,000 IOPS at some decent latency. Depending on the workload, you may only observe a fraction of that performance. &lt;/p&gt;
&lt;p&gt;Most of those high 80K-100K IOPS figures are obtained by benchmarking with very high queue depths (16-32). The SSD benefits from such queue depths because it can handle a lot of those I/O requests in parallel. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Please beware: if your workload doesn't fit in that pattern, you may see lower performance numbers.&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;If we take a look at the chart above of the Intel SSD we may notice how the IOPS figures only start to come close to the advertised 80K+ IOPS as the queue depth increases. It's therefore important to understand the characteristics of your own workload.&lt;/p&gt;
&lt;h3&gt;RAID&lt;/h3&gt;
&lt;p&gt;If we group several hard drives together we can create a RAID array. A RAID array is a virtual storage device that exceeds the capacity and performance of a single hard drive. This allows storage to scale within the limits of a single computer. &lt;/p&gt;
&lt;p&gt;RAID is also used (or some say primarily used) to assure availability by assuring redundancy (drive failure won't cause data loss). But for this article we focus it's performance characteristics. &lt;/p&gt;
&lt;p&gt;SSDs can achieve impressive sequential throughput speeds, of multiple gigabytes per second. Individual hard drives can never come close to those speeds, but if you put a lot of them together in a RAID array, you can come very close. For instance, &lt;a href="https://louwrentius.com/71-tib-diy-nas-based-on-zfs-on-linux.html"&gt;my own NAS&lt;/a&gt; an achieve such speeds using 24 drives.&lt;/p&gt;
&lt;p&gt;RAID also improves the performance of random access patterns. The hard drives in a RAID array work in tandem to service those I/O requests so a RAID array shows significantly higher IOPS than a single drive. More drives means more IOPS. &lt;/p&gt;
&lt;h4&gt;RAID 5 with 8 x 7200 RPM drives&lt;/h4&gt;
&lt;p&gt;The picture below shows the read IOPS performance of an 8-drive RAID 5 array of 1 TB, 7200 RPM drives. We run a benchmark of random 4K read requests.&lt;/p&gt;
&lt;p&gt;Notice how the IOPS increases as the queue depth increases. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/RAID/RAID5_8x1TB/MDADM-RAID-5---8-x-1-TB-%40-7200-RPM-2020-03-23_014228.png"&gt;&lt;img alt="raidiops" src="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/RAID/RAID5_8x1TB/MDADM-RAID-5---8-x-1-TB-%40-7200-RPM-2020-03-23_014228.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;However, nothing is free in this world. A higher queue depth - which acts as a buffer - does increase latency.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/RAID/RAID5_8x1TB/MDADM-RAID-5---8-x-1-TB-%40-7200-RPM-2020-03-23_014206.png"&gt;&lt;img alt="raidlat" src="https://raw.githubusercontent.com/louwrentius/fio-plot-data/master/images/RAID/RAID5_8x1TB/MDADM-RAID-5---8-x-1-TB-%40-7200-RPM-2020-03-23_014206.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Notice how quickly the latency exceeds 20ms and quickly becomes almost unusable.&lt;/p&gt;
&lt;h4&gt;RAID 5 with 8 x 10,000 RPM drives&lt;/h4&gt;
&lt;p&gt;Below is the result of a similar test with 10,000 RPM hard drives. Notice how much better the IOPS and latency figures are.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/raid510krpmiops.png"&gt;&lt;img alt="raid10kiops" src="https://louwrentius.com/static/images/raid510krpmiops.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The latency looks much better:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/raid510krpmlat.png"&gt;&lt;img alt="raid10klat" src="https://louwrentius.com/static/images/raid510krpmlat.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It makes sense to put SSDs in RAID. Although they are more reliable than hard drives, they can fail. If you care about availability, RAID is inevitable. Furthermore, you can observe the same benefits as with hard drives: you pool resources together, achieving higher IOPS figures and more capacity than possible with a single SSD.&lt;/p&gt;
&lt;h3&gt;Capacity vs. Performance&lt;/h3&gt;
&lt;p&gt;The following is mostly focussed on hard drives although it could be true for solid state drives as well. &lt;/p&gt;
&lt;p&gt;We put hard drives in RAID arrays to get more IOPS than a single drive can provide. At some point - as the workload increases - we may hit the maximum number of IOPS the RAID array can sustain with an acceptable latency. &lt;/p&gt;
&lt;p&gt;This IOPS/Latency threshold could be reached even if we have only 50% of the storage capacity of our RAID array in use. If we use the RAID array to host virtual machines for instance, we cannot add more virtual machines because this would cause the latency to rise to unacceptable levels. &lt;/p&gt;
&lt;p&gt;It may feel like a lot of good storage space is going to waste, and in some sense this may be true. For this reason, it could be a wise strategy to buy smaller 10,000 RPM or 15,000 RPM drives purely for the IOPS they can provide and forgo on capacity.&lt;/p&gt;
&lt;p&gt;So it might be the case that you may have to order and add let's say 10 more hard drives to meet the IOPS/Latency demands while there's still plenty of space left.&lt;/p&gt;
&lt;p&gt;This kind of situation is less likely as SSDs have taken over the role of the performance storage layer and (larger capacity) hard drives are pushed in the role of 'online' archival storage.&lt;/p&gt;
&lt;h3&gt;Closing words&lt;/h3&gt;
&lt;p&gt;I hope this article has given you a better understanding of storage performance. Although it is just an introduction, it may help you to better understand the challenges of storage performance. &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:throughput"&gt;
&lt;p&gt;https://en.wikipedia.org/wiki/Hard_disk_drive_performance_characteristics#Data_transfer_rate&amp;#160;&lt;a class="footnote-backref" href="#fnref:throughput" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="storage"/></entry><entry><title>Difference of behavior in SATA Solid State Drives</title><link href="https://louwrentius.com/difference-of-behavior-in-sata-solid-state-drives.html" rel="alternate"/><published>2020-01-29T00:00:00+01:00</published><updated>2020-01-29T00:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2020-01-29:/difference-of-behavior-in-sata-solid-state-drives.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I've noticed some strange behavior of SSDs when benchmarking them with FIO. After further investigation and additional testing, I've found the reason for the strange patterns in the graphs. &lt;/p&gt;
&lt;p&gt;The 'strange' test results are due to the fact that they were obtained by connecting the SSDs to a …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I've noticed some strange behavior of SSDs when benchmarking them with FIO. After further investigation and additional testing, I've found the reason for the strange patterns in the graphs. &lt;/p&gt;
&lt;p&gt;The 'strange' test results are due to the fact that they were obtained by connecting the SSDs to a P420I controller. As the HBA mode of this controller performs worse than the RAID mode, I used the RAID mode of this controller. Indvidual drives were put in a RAID0 volume. But it turns out that this creates a strange interaction between RAID controller and SSD.&lt;/p&gt;
&lt;p&gt;Additional testing with an SATA 300 AHCI controller shows 'normal' patterns that look similar to the results of the INTEL SSD as compared to the other ones (Samsung and Kingston). &lt;/p&gt;
&lt;p&gt;It seems I've made a mistake by using the P420i controller for testing. I have includes both 'bad' and 'good' results. &lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;Regular SATA solid state drives may seem interchangeable at this point. They all show amazing IOPS and latency performance.&lt;/p&gt;
&lt;p&gt;&lt;del&gt;I have performed benchmarks on different SSDs from different vendors and it seems that they actually show very different behaviour. This behavior has come to light because I benchmarked the entire device capacity.&lt;/del&gt;&lt;/p&gt;
&lt;p&gt;The benchmark - performed with &lt;a href="https://github.com/axboe/fio"&gt;FIO&lt;/a&gt; - puts a fifty percent read/write random 4K workload on the device. The benchmark stops when all sectors of the device have been read or written to. Furthermore, all tests are performed with a queue depth of 1.&lt;/p&gt;
&lt;p&gt;I've made this post because I found the results interesting. At least the images show a very peculiar pattern for some SSDs. I can't explain them really, maybe you can. &lt;/p&gt;
&lt;p&gt;This is the test I ran against the SSDs.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;fio --filename=/dev/sdX --direct=1 --rw=randrw --refill_buffers
--norandommap --ioengine=libaio --bs=4k --rwmixread=50 --iodepth=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Disclaimer&lt;/h2&gt;
&lt;p&gt;I've performed these benchmark to the best of my knowledge. The raw benchmark data is available &lt;a href="https://github.com/louwrentius/fio-plot-data/tree/master/benchmark_data/HPDL380G8/RAID/NEW/FULL"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It's always possible that I made a mistake, so it may be wise to run your own tests to see if you can replicate these results. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Caveat&lt;/strong&gt;: I really don't know if these benchmark results impact real-life performance. Maybe these benchmark results show a kind of behaviour of SSDs that doesn't really matter in the end.&lt;/p&gt;
&lt;h2&gt;Benchmark Results&lt;/h2&gt;
&lt;h3&gt;Intel D3-S4610&lt;/h3&gt;
&lt;p&gt;This SSD is meant for for datacenter usage. This is the test result on the P420i controller.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/INTEL_D3-S4610_Random_RW_(50%25)_Full_Device_Read+Write_2019-11-28_144750.png?raw=true"&gt;&lt;img alt="intel" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/INTEL_D3-S4610_Random_RW_(50%25)_Full_Device_Read+Write_2019-11-28_144750.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;IOPS and Latency is consistent during the whole benchmark. It's behaviour seems predictable. &lt;/p&gt;
&lt;p&gt;This is the test result on the AHCI controller:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/INTEL-D3-S4610-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_111850.png?raw=true"&gt;&lt;img alt="intelahci" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/INTEL-D3-S4610-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_111850.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Samsung 860 Pro&lt;/h3&gt;
&lt;p&gt;This SSD is meant for desktop usage. Its behavior seems quite different from the Intel SSD. I have separated the IOPS data from the Latency data to make the graphs more eligible. &lt;/p&gt;
&lt;p&gt;This is the test result on the P420i controller.&lt;/p&gt;
&lt;h4&gt;IOPS&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_171841.png?raw=true"&gt;&lt;img alt="samsung860iops" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_171841.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Latency&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_171858.png?raw=true"&gt;&lt;img alt="samsung860latency" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_171858.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The best-case latency is almost four times better than the worst-case latency. Latency is thus less predictable. This impact also seems to be reflected in the IOPs numbers. &lt;/p&gt;
&lt;p&gt;This is the test result on the AHCI controller:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-30_231329.png?raw=true"&gt;&lt;img alt="samsung860ahci" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-860-PRO-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-30_231329.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Samsung PM883&lt;/h2&gt;
&lt;p&gt;This SSD is meant for datacenter usage. This is the test result on the P420i controller.&lt;/p&gt;
&lt;h3&gt;IOPS&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_174112.png?raw=true"&gt;&lt;img alt="samsungpm883iops" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_174112.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Latency&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_174135.png?raw=true"&gt;&lt;img alt="samsungpm883latency" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_174135.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This SSD seems to behave in a similar way as the 860 PRO.&lt;/p&gt;
&lt;p&gt;This is the test result on the AHCI controller:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_144732.png?raw=true"&gt;&lt;img alt="samsungpm8832ahci" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/SAMSUNG-PM883-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_144732.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Kingston DC500M&lt;/h2&gt;
&lt;p&gt;This SSD is meant for datacenter usage. This is the test result on the P420i controller.&lt;/p&gt;
&lt;h3&gt;IOPS&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_175551.png?raw=true"&gt;&lt;img alt="kingstondc500miops" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-RANDOM-RW-(50%25)-Full-Device-Read+Write-IOPS-2020-01-29_175551.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;latency&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_175612.png?raw=true"&gt;&lt;img alt="kingstondc500mlatency" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-RANDOM-RW-(50%25)-Full-Device-Read+Write-Latency-2020-01-29_175612.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The behavior of this SSD seems similar to the behaviour of the Samsung SSDs but the pattern is distinct: it seems shifted as compared to the Samsung SSDs.&lt;/p&gt;
&lt;p&gt;This is the test result on the AHCI controller:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_191351.png?raw=true"&gt;&lt;img alt="kingstondc500mahci" src="https://github.com/louwrentius/fio-plot-data/blob/master/images/KINGSTON-DC500M-ON-AHCI-SATA-300-FULL-DISK-4K-RANDOM-READ-WRITE-50%25-2020-01-31_191351.png?raw=true" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Evaluation&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;** Updated evaluation**&lt;/p&gt;
&lt;p&gt;We can conclude that the P420i RAID controller causes strange behavior not observed when we test the SSDs on a regular AHCI controller. Although this was an older SATA 300 controller, I'm making the assumption that this controller still has enough bandwidth to support a random 4K test as most tests never went beyond 50+ MB/s of throughput.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;At this point, I can only say that I observe quite different behavior between the Intel SSD and the other SSDs from Samsung and Kingston. The problem is that I can't tell if this affects real-life day-to-day application performance.&lt;/p&gt;
&lt;p&gt;It seems that although results for the Samsung and Kingston SSDs fluctuate quite a bit, it's quite possible that the fluctuations occur during a very short timespan and effectively cancel each other out. &lt;/p&gt;
&lt;p&gt;If you have comments, ideas or suggestions, leave a comment below.&lt;/p&gt;
&lt;h2&gt;How are these images generated?&lt;/h2&gt;
&lt;p&gt;All images have been generated with &lt;a href="https://github.com/louwrentius/fio-plot"&gt;fio-plot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The github repository also contains a &lt;a href="https://github.com/louwrentius/fio-plot-data/tree/master/images"&gt;folder with a lot of example images&lt;/a&gt;.&lt;/p&gt;</content><category term="Storage"/><category term="storage"/></entry><entry><title>My Ceph test cluster based on Raspberry Pi's and HP MicroServers</title><link href="https://louwrentius.com/my-ceph-test-cluster-based-on-raspberry-pis-and-hp-microservers.html" rel="alternate"/><published>2019-01-27T00:00:00+01:00</published><updated>2019-01-27T00:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2019-01-27:/my-ceph-test-cluster-based-on-raspberry-pis-and-hp-microservers.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;To learn more about Ceph, I've build myself a Ceph Cluster based on actual hardware. In this blogpost I'll discus the cluster in more detail and I've also included (&lt;a href="http://freecode.com/projects/fio"&gt;fio&lt;/a&gt;) benchmark results.&lt;/p&gt;
&lt;p&gt;This is my test Ceph cluster: &lt;/p&gt;
&lt;p&gt;&lt;img alt="picluster" src="https://louwrentius.com/static/images/piclustersmall.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The cluster consists of the following components:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt; 3 x Raspberry Pi …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;To learn more about Ceph, I've build myself a Ceph Cluster based on actual hardware. In this blogpost I'll discus the cluster in more detail and I've also included (&lt;a href="http://freecode.com/projects/fio"&gt;fio&lt;/a&gt;) benchmark results.&lt;/p&gt;
&lt;p&gt;This is my test Ceph cluster: &lt;/p&gt;
&lt;p&gt;&lt;img alt="picluster" src="https://louwrentius.com/static/images/piclustersmall.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The cluster consists of the following components:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt; 3 x Raspberry Pi 3 Model B+ as Ceph monitors
 4 x HP MicroServer as OSD nodes (3 x Gen8 + 1 x Gen10)
 4 x 4 x 1 TB drives for storage (16 TB raw)
 3 x 1 x 250 GB SSD (750 GB raw)
 2 x 5-port Netgear switches for Ceph backend network (bonding)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Monitors: Raspberry Pi 3 Model B+&lt;/h2&gt;
&lt;p&gt;I've done some work getting &lt;a href="https://louwrentius.com/compiling-ceph-on-the-raspberry-pi-3b-armhf-using-clangllvm.html"&gt;Ceph compiled&lt;/a&gt; on a Raspberry Pi 3 Model B+ running Raspbian. I'm using three Raspberry Pi's as Ceph monitor nodes. The Pi boards don't break a sweat with this small cluster setup.&lt;/p&gt;
&lt;p&gt;Note: Raspberry Pi's are not an ideal choice as a monitor node because Ceph Monitors write data (probably the cluster state) to disk every few seconds. This will wear out the SD card eventually. &lt;/p&gt;
&lt;h2&gt;Storage nodes: HP MicroServer&lt;/h2&gt;
&lt;p&gt;The storage nodes are based on four HP MicroServers. I really like these small boxes, they are sturdy, contain server-grade components, including ECC-memory and have room for four internal 3.5" hard drives. You can also install 2.5" hard drives or SSDs. &lt;/p&gt;
&lt;p&gt;For more info on the &lt;a href="https://louwrentius.com/zfs-performance-on-hp-proliant-microserver-gen8-g1610t.html"&gt;Gen8&lt;/a&gt; and the &lt;a href="https://louwrentius.com/hp-proliant-microserver-gen10-as-router-or-nas.html"&gt;Gen10&lt;/a&gt; click on their links.&lt;/p&gt;
&lt;p&gt;Unfortunately the Gen8 servers are no longer made. The replacement, the Gen10 model, lacks IPMI/iLO and is also much more expensive (in Europe at least).&lt;/p&gt;
&lt;h4&gt;CPU and RAM&lt;/h4&gt;
&lt;p&gt;All HP Microservers have a dual-core CPU. The Gen8 servers have 10GB RAM and the Gen10 server has 12GB RAM. I've just added an 8GB ECC memory module to each server, the Gen10 comes with 4GB and the Gen8 came with only 2GB, which explains the difference.&lt;/p&gt;
&lt;h4&gt;Boot drive&lt;/h4&gt;
&lt;p&gt;The systems all have an (old) internal 2.5" laptop HDD connected to the internal USB 2.0 header using an USB enclosure.&lt;/p&gt;
&lt;h4&gt;Ceph OSD HDD&lt;/h4&gt;
&lt;p&gt;All servers are fitted with four (old) 1TB 7200 RPM 3.5" hard drives, so the entire cluster contains 16 x 1TB drives. &lt;/p&gt;
&lt;h4&gt;Ceph OSD SSD&lt;/h4&gt;
&lt;p&gt;There is a fifth SATA connector on the motherboard, meant for an optional optical drive, which I have no use for and wich is not included with the servers. &lt;/p&gt;
&lt;p&gt;I use this SATA connector in the Gen8 MicroServers to attach a Crucial 250GB SSD, which is then tucked away at the top, where the optical drive would sit. So the Gen8 servers have an SSD installed which the Gen10 is lacking.&lt;/p&gt;
&lt;p&gt;The entire cluster thus has 3 x 250GB SSDs installed. &lt;/p&gt;
&lt;h2&gt;Networking&lt;/h2&gt;
&lt;p&gt;All servers have two 1Gbit network cards on-board and a third one installed in one of the half-height PCIe slots&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;&lt;img alt="backside" src="https://louwrentius.com/static/images/cephclusterback.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The half-height PCIe NICs connect the Microservers to the &lt;em&gt;public&lt;/em&gt; network. The internal gigabit NICs are configured in a &lt;a href="https://louwrentius.com/achieving-450-mbs-network-file-transfers-using-linux-bonding.html"&gt;bond&lt;/a&gt; (round-robin) and connected to two 5-port Netgear gigabit switches. This is the &lt;em&gt;cluster&lt;/em&gt; network or the backend network Ceph uses for replicating data between the storage nodes.&lt;/p&gt;
&lt;p&gt;You may notice that the first onboard NIC of each server is connected to the top switch and the second one is connected to the bottom switch. This is necessary because linux round-robin bonding requires either separate VLANs for each NIC or in this case separate switches.&lt;/p&gt;
&lt;h2&gt;Benchmarks&lt;/h2&gt;
&lt;h3&gt;Benchmark conditions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;The tests ran on a physical Ceph client based on an older dual-core CPU and 8GB of RAM. This machine was connected to the cluster with a single gigabit network card.&lt;/li&gt;
&lt;li&gt;I've mapped RBD block devices from the HDD pool and the SSD pool on this machine for benchmarking. &lt;/li&gt;
&lt;li&gt;All tests have been performed on the raw /dev/rbd0 device, not on any file or filesystem. &lt;/li&gt;
&lt;li&gt;The pools use replication with a minimal copy count of 1 and a maximum of 3. &lt;/li&gt;
&lt;li&gt;All benchmarks have been performed with FIO. &lt;/li&gt;
&lt;li&gt;All benchmarks used random 4K reads/writes&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    NAME     ID     USED        %USED     MAX AVAIL     OBJECTS
    hdd      36     1.47TiB     22.64       5.03TiB      396434
    ssd      38      200GiB     90.92       20.0GiB       51204
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Benchmark SSD&lt;/h3&gt;
&lt;p&gt;Click on the images below to see a larger version. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandread-iops.png"&gt;&lt;img alt="a" src="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandread-iops.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandread-lat.png"&gt;&lt;img alt="b" src="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandread-lat.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandwrite-iops.png"&gt;&lt;img alt="c" src="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandwrite-iops.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandwrite-lat.png"&gt;&lt;img alt="d" src="https://louwrentius.com/static/images/ssd-3d-iops-jobsrandwrite-lat.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hp-ceph-2d-randread-ssd.png"&gt;&lt;img alt="e" src="https://louwrentius.com/static/images/hp-ceph-2d-randread-ssd.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hp-ceph-2d-randwrite-ssd.png"&gt;&lt;img alt="f" src="https://louwrentius.com/static/images/hp-ceph-2d-randwrite-ssd.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Benchmark HDD&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandread-iops.png"&gt;&lt;img alt="g" src="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandread-iops.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandread-lat.png"&gt;&lt;img alt="h" src="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandread-lat.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandwrite-iops.png"&gt;&lt;img alt="i" src="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandwrite-iops.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandwrite-lat.png"&gt;&lt;img alt="j" src="https://louwrentius.com/static/images/hdd-3d-iops-jobsrandwrite-lat.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hp-ceph-2d-randread-hdd.png"&gt;&lt;img alt="k" src="https://louwrentius.com/static/images/hp-ceph-2d-randread-hdd.png" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/hp-ceph-2d-randwrite-hdd.png"&gt;&lt;img alt="l" src="https://louwrentius.com/static/images/hp-ceph-2d-randwrite-hdd.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Benchmark evaluation&lt;/h2&gt;
&lt;p&gt;The random read performance of the hard drives seems unrealistic at higher queue depths and number of simultaneous jobs. This performance cannot be sustained purely on the basis that 16 hard drives with maybe 70 random IOPs each can only sustain 1120 random IOPs.&lt;/p&gt;
&lt;p&gt;I cannot explain why I get these numbers. If anybody has a suggestion, feel free to comment/respond. Maybe the total of 42GB of memory across the cluster may act as some kind of cache.&lt;/p&gt;
&lt;p&gt;Another interesting observation is that a low number of threads and a small IO queue depth results in fairly poor performance, both for SSD and HDD media. &lt;/p&gt;
&lt;p&gt;Especially the performance of the SSD pool is poor with a low IO queue depth. A probable cause is that these SSDs are consumer-grade and don't perform well with low queue depth workloads. &lt;/p&gt;
&lt;p&gt;I find it interesting that even over a single 1Gbit link, the SSD-backed pool is able to sustain 20K+ IOPs at higher queue depths and larger number of threads.&lt;/p&gt;
&lt;p&gt;The small number of storage nodes and the low number of OSDs per node doesn't make this setup ideal but it does seem to perform fairly decent, considering the hardware involved. &lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;You may notice that the Pi's are missing in the picture because this is an older picture when I was running the monitors as virtual machines on hardware not seen in the picture.&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="Ceph"/></entry><entry><title>Compiling Ceph on the Raspberry Pi 3B+ (armhf) using Clang/LLVM</title><link href="https://louwrentius.com/compiling-ceph-on-the-raspberry-pi-3b-armhf-using-clangllvm.html" rel="alternate"/><published>2018-11-10T04:00:00+01:00</published><updated>2018-11-10T04:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2018-11-10:/compiling-ceph-on-the-raspberry-pi-3b-armhf-using-clangllvm.html</id><summary type="html">&lt;h2&gt;UPDATE 2019 / 2020&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;There are &lt;a href="https://download.ceph.com/debian-nautilus/pool/main/c/ceph/"&gt;official ARM64 binaries of Ceph&lt;/a&gt; that you can run on a &lt;a href="https://ubuntu.com/download/raspberry-pi"&gt;64-bit version of Ubuntu 18.04&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important: I consider this page obsolete. I will keep it up for transparency's sake&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this blog post I'll show you how to compile Ceph Luminous for …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;UPDATE 2019 / 2020&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;There are &lt;a href="https://download.ceph.com/debian-nautilus/pool/main/c/ceph/"&gt;official ARM64 binaries of Ceph&lt;/a&gt; that you can run on a &lt;a href="https://ubuntu.com/download/raspberry-pi"&gt;64-bit version of Ubuntu 18.04&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Important: I consider this page obsolete. I will keep it up for transparency's sake&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this blog post I'll show you how to compile Ceph Luminous for the Raspberry Pi 3B+.&lt;/p&gt;
&lt;p&gt;If you follow the instructions below you can compile Ceph on Raspbian. A note of warning: we will compile Ceph on the Raspberry Pi itself which takes a lot of time.&lt;/p&gt;
&lt;p&gt;Ubuntu has packages for Ceph on armhf but I was never able to get Ubuntu working properly on the Raspberry Pi 3B+. Maybe that's just me and I did something wrong. Using existing Ceph packages on Ubuntu would probably be the fastest way to get up and running on the Raspberry Pi if it works for you.&lt;/p&gt;
&lt;p&gt;This is my test Ceph cluster: &lt;/p&gt;
&lt;p&gt;&lt;img alt="picluster" src="https://louwrentius.com/static/images/piclustersmall.jpg" /&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Raspberry&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Pi&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="nv"&gt;B&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Ceph&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;monitors&lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;HP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Microserver&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;OSD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;nodes&lt;/span&gt;.
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;TB&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;drives&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;storage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;TB&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raw&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;250&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;GB&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;SSD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;750&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;GB&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;raw&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Netgear&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;switches&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Ceph&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;backend&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;network&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;bonding&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;For the impatient&lt;/h2&gt;
&lt;p&gt;If you just want the packages you can download &lt;a href="https://louwrentius.com/files/ceph-on-armhf-12.2.9.tgz"&gt;this file&lt;/a&gt; and you'll get a set of .deb files which you need to install on your Raspberry Pi. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SECURITY WARNING&lt;/strong&gt;: these packages are created by me, an unknown, untrusted person on the internet. As a general rule you should &lt;em&gt;not&lt;/em&gt; download and install these packages as they could be malicious for all you know. If you want to be safe, compile Ceph yourself. &lt;/p&gt;
&lt;p&gt;Skip to the section about installing the packages at the end for further installation instructions. &lt;/p&gt;
&lt;h2&gt;The problem with compiling Ceph for armhf&lt;/h2&gt;
&lt;p&gt;There are no armhf packages for Ceph because if you try to compile Ceph on armhf the compiler (gcc) will run out of virtual memory (about three gigabytes).&lt;/p&gt;
&lt;h2&gt;The solution&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://tracker.ceph.com/issues/23387"&gt;Daniel Glaser discovered&lt;/a&gt; that he could actually compile Ceph on armhf by using Clang/LLVM as the C++ compiler. This compiler seems to use less memory and thus stay within the 3 GB memory boundary. This is why he and I were able to compile Ceph.&lt;/p&gt;
&lt;h2&gt;How to compile Ceph for armhf - preparation&lt;/h2&gt;
&lt;h3&gt;The challenge: one gigabyte of memory&lt;/h3&gt;
&lt;p&gt;The Raspberry Pi 3B+ has only one gigabyte of memory but we need more. The only way to add memory is to use swap on disk, as far as I know. &lt;/p&gt;
&lt;p&gt;If you use storage as a substitute for RAM memory, you need fast storage, so it's really recommended to use an external SSD drive that you connect through USB. You also may need sufficient storage, I'd recommend 20+ GB. &lt;/p&gt;
&lt;p&gt;SD memory cards are not up to the task regarding being used as swap. You'll wear them out prematurely and performance is abysmal. You should really use an external SSD.&lt;/p&gt;
&lt;h3&gt;Preparing the external SSD&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Attach the SSD drive to the Raspberry Pi with USB
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;The SSD will probably show up as '/dev/sda'.&lt;/li&gt;
&lt;li&gt;mkfs.xfs /dev/sda -f (&lt;strong&gt; this will erase all contents of the SSD &lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;mkdir /mnt/ssd&lt;/li&gt;
&lt;li&gt;mount /dev/sda /mnt/ssd&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Creating and activating swap&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;cd /mnt/ssd&lt;/li&gt;
&lt;li&gt;dd if=/dev/zero of=swap.dd bs=1M count=5000&lt;/li&gt;
&lt;li&gt;swapon /mnt/ssd/swap.dd&lt;/li&gt;
&lt;li&gt;swapoff /var/swap &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By default, Raspbian configures a 100 MB swap file on /var/swap. In order to increase performance and protect the SD card from wearing out, please don't forget this last step to disable this swap file on the SD card.&lt;/p&gt;
&lt;h3&gt;Extra software&lt;/h3&gt;
&lt;p&gt;I would recommend installing 'htop' for real-time monitoring of cpu, memory and swap usage if you like to do so.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;apt-get install htop&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;How to compile Ceph for armhf - building&lt;/h2&gt;
&lt;h3&gt;Installing an alternative C++ compiler (Clang/LLVM)&lt;/h3&gt;
&lt;p&gt;As part of &lt;a href="http://tracker.ceph.com/issues/23387"&gt;Daniel's instructions&lt;/a&gt;, you need to compile and install Clang/LLVM.
I followed his instructions to the letter, I have not tested the Clang/LLVM packages made available through apt.&lt;/p&gt;
&lt;p&gt;Compiling Clang/LLVM takes a lot of time. It took 8 hours to compile LLVM/Clang on a Raspberry Pi 3B+ with make -j3 to limit memory usage.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;real    493m38.472s
user    1223m39.063s
sys 45m45.748s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I'll reproduce the steps from Daniel here:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;
&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;essential&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ca&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;certificates&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vim&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="n"&gt;apt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libcunit1&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;libcurl4&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;openssl&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;bcrypt&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;tox&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;coverage&lt;/span&gt;

&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mnt&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssd&lt;/span&gt;
&lt;span class="n"&gt;mkdir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mirror&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mirror&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;clone&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;https&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;github&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mirror&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;lld&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;
&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;
&lt;span class="n"&gt;mkdir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="n"&gt;cmake&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;G&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Unix Makefiles&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DCMAKE_BUILD_TYPE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Release&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;DLLVM_TARGETS_TO_BUILD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;ARM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mnt&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ssd&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;llvm&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;j3&lt;/span&gt;
&lt;span class="n"&gt;make&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;
&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;alternatives&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;cc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;alternatives&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;
&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;alternatives&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;cpp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;cpp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;usr&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;local&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;clang&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;cpp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You may chose to build in some other directory, maybe on the SSD itself. I'm not sure if that makes a big difference. Be carefull when using /tmp as all contents are lost after a reboot.&lt;/p&gt;
&lt;h3&gt;Obtaining Ceph&lt;/h3&gt;
&lt;p&gt;There are two options:
1. clone my &lt;a href="https://github.com/louwrentius/ceph"&gt;Luminous fork&lt;/a&gt; containing the branch 'ceph-on-arm' which incorporates all the 'fixed' files that make Ceph build with Clang/LLVM.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clone the official Ceph repo and use the luminous branche. Next, you edit all the relevant files and make the changes yourself. &lt;a href="https://github.com/louwrentius/ceph/compare/luminous...louwrentius:ceph-on-arm"&gt;Here&lt;/a&gt; you can find a list of all the files and the changes made to them.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I would recommend to just git clone ceph like this: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cd /mnt/ssd
git clone https://github.com/louwrentius/ceph
cd ceph
git checkout ceph-on-arm
git reset --hard
git clean -dxf
git submodule update --init --recursive
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we first need to install a lot of dependancies on the Raspberry Pi before we can build Ceph. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;run ./install-deps.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This will take some time as a ton of packages will be installed. Once this is done we are ready to compile Ceph itself.&lt;/p&gt;
&lt;h3&gt;Building Ceph&lt;/h3&gt;
&lt;p&gt;So to understand what you are getting into: it took me about 12 hours to compile Ceph on a Raspberry Pi 3 B+&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;real    717m31.457s
user    1319m50.438s
sys 58m7.549s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is the command to run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;./make-debs.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you want to monitor cpu and memory usage, you can use 'htop' to do so.&lt;/p&gt;
&lt;p&gt;If for some reason the compile proces does fail and you may have to restart compiling ceph after you made some adjustments: &lt;/p&gt;
&lt;p&gt;(you may have to adjust the folder name to match your ceph version)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nx"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;release&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;Raspbian&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;WORKDIR&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;ceph&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m m-Double"&gt;12.2.9&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;gd51dfb14f4&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;edit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;relevant&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;here&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;dpkg&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;buildpackage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;j3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;us&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;us&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;nc&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once this process is done, you will find a lot of .deb packages in your 
/tmp/release/Raspbian/WORKDIR folder. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Warning&lt;/strong&gt; If you do use /tmp, the first thing to do is to copy all .deb files to a safe location because if you reboot your Pi, you loose 12 hours of work. &lt;/p&gt;
&lt;p&gt;Assuming that you copied all .deb files to a folder like '/deb' you just created, this is how you install these packages:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dpkg --install *.deb
apt-get install --fix-missing
apt --fix-broken install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is a bit ugly but it worked fine for me. &lt;/p&gt;
&lt;p&gt;You can now just copy over all the .deb files to other Raspbery Pi's and install Ceph on them too. &lt;/p&gt;
&lt;p&gt;Now you are done and you can run Ceph on a Raspberry Pi 3B+. &lt;/p&gt;
&lt;h3&gt;Ceph monitors may wear out the SD card&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt; Running a Ceph monitor node on a Raspberry Pi is not ideal. The core issue is that the Ceph monitor process writes data every few seconds to files within /var/lib/ceph and this may wear out the SD card prematurely. The solution would be to use an external usb hard drive mounted through USB or a regular ssd which is way more resilient to writes than a regular SD card.&lt;/p&gt;</content><category term="Storage"/><category term="Ceph"/></entry><entry><title>Understanding Ceph: open-source scalable storage</title><link href="https://louwrentius.com/understanding-ceph-open-source-scalable-storage.html" rel="alternate"/><published>2018-08-19T04:00:00+02:00</published><updated>2018-08-19T04:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2018-08-19:/understanding-ceph-open-source-scalable-storage.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this blog post I will try to explain why I believe &lt;a href="https://en.wikipedia.org/wiki/Ceph_(software)"&gt;Ceph&lt;/a&gt; is such an interesting storage solution. After you finished reading this blog post you should have a good high-level overview of Ceph.&lt;/p&gt;
&lt;p&gt;I've written this blog post purely because I'm a storage enthusiast and I find …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In this blog post I will try to explain why I believe &lt;a href="https://en.wikipedia.org/wiki/Ceph_(software)"&gt;Ceph&lt;/a&gt; is such an interesting storage solution. After you finished reading this blog post you should have a good high-level overview of Ceph.&lt;/p&gt;
&lt;p&gt;I've written this blog post purely because I'm a storage enthusiast and I find Ceph interesting technology.&lt;/p&gt;
&lt;h2&gt;What is Ceph?&lt;/h2&gt;
&lt;p&gt;Ceph is a software-defined storage solution that can scale both in performance and capacity. Ceph is used to build multi-petabyte storage clusters. &lt;/p&gt;
&lt;p&gt;For example, &lt;a href="https://home.cern/about"&gt;Cern&lt;/a&gt; has build a &lt;a href="https://ceph.com/community/new-luminous-scalability/"&gt;65 Petabyte&lt;/a&gt; Ceph storage cluster. I hope that number grabs your attention. I think it's amazing.&lt;/p&gt;
&lt;p&gt;The basic building block of a Ceph storage cluster is the storage node. These storage nodes are just commodity (&lt;a href="https://en.wikipedia.org/wiki/Commercial_off-the-shelf"&gt;COTS&lt;/a&gt;) servers containing a lot of hard drives and/or flash storage.&lt;/p&gt;
&lt;p&gt;&lt;img alt="storage chassis" src="https://louwrentius.com/static/images/sm36.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Example of a storage node&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Ceph is meant to scale. And you scale by adding additional storage nodes. You will need multiple servers to satisfy your capacity, performance and resiliency requirements. And as you expand the cluster with extra storage nodes, capacity, performance and resiliency (if needed) will all increase at the same time. &lt;/p&gt;
&lt;p&gt;It's that simple.&lt;/p&gt;
&lt;p&gt;You don't need to start with petabytes of storage. You can actually start very small, with just a few storage nodes and expand as your needs increase.&lt;/p&gt;
&lt;p&gt;I want to touch upon a technical detail because it illustrates the mindset surrounding Ceph. With Ceph, you don't even need a RAID controller anymore, a 'dumb' HBA is sufficient. This is possible because Ceph manages redundancy in software. A Ceph storage node at it's core is more like a &lt;a href="https://en.wiktionary.org/wiki/JBOD"&gt;JBOD&lt;/a&gt;. The hardware is simple and 'dumb', the intelligence resides all in software.&lt;/p&gt;
&lt;p&gt;This means that the risk of hardware vendor lock-in is quite mitigated. You are not tied to any particular proprietary hardware.&lt;/p&gt;
&lt;h2&gt;What makes Ceph special?&lt;/h2&gt;
&lt;p&gt;At the heart of the Ceph storage cluster is the &lt;a href="https://ceph.com/wp-content/uploads/2016/08/weil-crush-sc06.pdf"&gt;CRUSH&lt;/a&gt; algoritm, developed by &lt;a href="https://en.wikipedia.org/wiki/Sage_Weil"&gt;Sage Weil&lt;/a&gt;, the co-creator of Ceph. &lt;/p&gt;
&lt;p&gt;The CRUSH algoritm allows storage &lt;em&gt;clients&lt;/em&gt; to &lt;strong&gt;calculate&lt;/strong&gt; which storage node needs to be contacted for retrieving or storing data. The storage client can - &lt;em&gt;on it's own&lt;/em&gt; - determine what to do with data or where to get it. &lt;/p&gt;
&lt;p&gt;So to reiterate: given a particular state of the storage cluster, the client can calculate which storage node to contact for storage or retrieval of data.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Why is this so special?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Because there is &lt;strong&gt;no&lt;/strong&gt; centralised 'registry' that keeps track of the location of data on the cluster (metadata). Such a centralised registry can become:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a performance bottleneck, preventing further expansion&lt;/li&gt;
&lt;li&gt;a single-point-of-failure&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ceph does away with this concept of a centralised registry for data storage and retrieval. This is why Ceph can scale in capacity and performance while assuring availability.&lt;/p&gt;
&lt;p&gt;At the core of the CRUSH algoritm is the &lt;em&gt;CRUSH map&lt;/em&gt;. That map contains information about the storage nodes in the cluster. That map is the basis for the calculations the storage client need to perform in order to decide which storage node to contact.&lt;/p&gt;
&lt;p&gt;This CRUSH map is distributed across the cluster from a special server: the 'monitor' node. Regardless of the size of the Ceph storage cluster, you typically need just three (3) monitor nodes for the whole cluster. Those nodes are contacted by both the storage nodes and the storage clients.&lt;/p&gt;
&lt;p&gt;&lt;img alt="cephoverview" src="https://louwrentius.com/static/images/cephsimple.png" /&gt;&lt;/p&gt;
&lt;p&gt;So Ceph does have some kind of centralised 'registry' but it serves a totally different purpose. It only keeps track of the state of the cluster, a task that is way easier to scale than running a 'registry' for data storage/retrieval itself. &lt;/p&gt;
&lt;p&gt;It's important to keep in mind that the Ceph monitor node does not store or process any metadata. It only keeps track of the CRUSH map for both clients and individual storage nodes. Data always flows directly from the storage node towards the client and vice versa.&lt;/p&gt;
&lt;h2&gt;Ceph Scalability&lt;/h2&gt;
&lt;p&gt;A storage client will contact the appropriate storage node directly to store or retrieve data. There are no components in between, except for the network, which you will need to size accordingly&lt;sup id="fnref:fn1"&gt;&lt;a class="footnote-ref" href="#fn:fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;Because there are no intermediate components or proxies that could potentially create a bottleneck, a Ceph cluster can really scale horizontally in both capacity and performance. &lt;/p&gt;
&lt;p&gt;And while scaling storage and performance, data is protected by redundancy.&lt;/p&gt;
&lt;h2&gt;Ceph redundancy&lt;/h2&gt;
&lt;h3&gt;Replication&lt;/h3&gt;
&lt;p&gt;In a nutshell, Ceph does 'network' RAID-1 (replication) or 'network' RAID-5/6 (erasure encoding). What do I mean by this? Imagine a RAID array but now also imagine that instead of the array consisting of hard drives, it consist of entire servers.&lt;/p&gt;
&lt;p&gt;That's what Ceph does: it distributes the data across multiple storage nodes and assures that the copy of a piece of data is never stored on the same storage node. &lt;/p&gt;
&lt;p&gt;This is what happens if a client writes two blocks of data:&lt;/p&gt;
&lt;p&gt;&lt;img alt="replication" src="https://louwrentius.com/static/images/cephreplication.png" /&gt;&lt;/p&gt;
&lt;p&gt;Notice how a copy of the data block is always replicated to other hardware.&lt;/p&gt;
&lt;p&gt;Ceph goes beyond the capabilities of regular RAID. You can configure more than one replica. You are not confined to RAID-1 with just one backup copy of your data&lt;sup id="fnref:fn2"&gt;&lt;a class="footnote-ref" href="#fn:fn2"&gt;2&lt;/a&gt;&lt;/sup&gt;. The only downside of storing more replicas is the storage cost. &lt;/p&gt;
&lt;p&gt;You may decide that data availability is so important that you may have to sacrifice space and absorb the cost. Because at scale, a simple RAID-1 replication scheme may not sufficiently cover the risk and impact of hardware failure anymore. What if two storage nodes in the cluster die? &lt;/p&gt;
&lt;p&gt;This example or consideration has nothing to do with Ceph, it's a reality you face when you operate at scale.&lt;/p&gt;
&lt;p&gt;RAID-1 or the Ceph equivalent 'replication' offers the best overall performance but as with 'regular' RAID-1, it is not very storage space efficient. Especially if you need more than one replica of the data to achieve the level of redundancy you need.&lt;/p&gt;
&lt;p&gt;This is why we used RAID-5 and RAID-6 in the past as an alternative to RAID-1 or RAID-10. Parity RAID assures redundancy but with much less storage overhead at the cost of storage performance (mostly write performance). Ceph uses 'erasure encoding' to achieve a similar result.&lt;/p&gt;
&lt;h3&gt;Erasure Encoding&lt;/h3&gt;
&lt;p&gt;With Ceph you are not confined to the limits of RAID-5/RAID-6 with just one or two 'redundant disks' (in Ceph's case storage nodes). Ceph allows you to use &lt;a href="https://ceph.com/community/new-luminous-erasure-coding-rbd-cephfs/"&gt;&lt;em&gt;Erasure Encoding&lt;/em&gt;&lt;/a&gt;, a technique that let's you tell Ceph this: &lt;/p&gt;
&lt;p&gt;&lt;em&gt;"I want you to chop up my data in 8 data segments and 4 parity segments"&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="erasureencodig" src="https://louwrentius.com/static/images/erasureencoding.png" /&gt;&lt;/p&gt;
&lt;p&gt;These segments are then scattered across the storage nodes and this allows you to lose up to four entire hosts before you hit trouble. You will have only 33% storage overhead for redundancy instead of 50% (or even more) you may face using replication, depending on how many copies you want. &lt;/p&gt;
&lt;p&gt;This example does assume that you have at least 8 + 4 = 12 storage nodes. But any scheme will do, you could do 6 data segments + 2 parity segments (similar to RAID-6) with only 8 hosts. I think you catch the idea.&lt;/p&gt;
&lt;h2&gt;Ceph failure domains&lt;/h2&gt;
&lt;p&gt;Ceph is datacenter-aware. What do I mean by that? Well, the CRUSH map can represent your physical datacenter topology, consisting of racks, rows, rooms, floors, datacenters and so on. You can fully customise your topology.&lt;/p&gt;
&lt;p&gt;This allows you to create very clear data storage policies that Ceph will use to assure the cluster can tollerate failures across certain boundaries. &lt;/p&gt;
&lt;p&gt;An example of a topology:&lt;/p&gt;
&lt;p&gt;&lt;img alt="topology" src="https://louwrentius.com/static/images/cephtopology.png" /&gt;&lt;/p&gt;
&lt;p&gt;If you want, you can lose a whole rack. Or a whole row of racks and the cluster could still be fully operational, although with reduced performance and capacity.&lt;/p&gt;
&lt;p&gt;That much redundancy may cost so much storage that you may not want to employ it for all of your data. That's no problem. You can create multiple storage pools that each have their own protection level and thus cost.&lt;/p&gt;
&lt;h2&gt;How do you use Ceph?&lt;/h2&gt;
&lt;p&gt;Ceph at it's core is an object storage solution. Librados is the library you can include within your software project to access Ceph storage natively. There are Librados implementations for the following programming languages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;C(++)&lt;/li&gt;
&lt;li&gt;Java&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;PHP&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Many people are looking for more traditional storage solutions, like &lt;a href="http://docs.ceph.com/docs/mimic/rbd/"&gt;block storage&lt;/a&gt; for storing virtual machines, a POSIX compliant &lt;a href="http://docs.ceph.com/docs/mimic/cephfs/"&gt;shared file system&lt;/a&gt; or &lt;a href="http://docs.ceph.com/docs/mimic/radosgw/"&gt;S3/OpenStack Swift compatible&lt;/a&gt; object storage. &lt;/p&gt;
&lt;p&gt;Ceph provides &lt;em&gt;all those features&lt;/em&gt; in addition to it's native object storage format.&lt;/p&gt;
&lt;p&gt;I myself are mostly interested in block storage (Rados Block Device)(RBD) with the purpose of storing virtual machines. As Linux has native support for RBD, it makes total sense to use Ceph as a storage backend for OpenStack or plain KVM.&lt;/p&gt;
&lt;p&gt;With very recent versions of Ceph, native support for &lt;a href="http://docs.ceph.com/docs/mimic/rbd/iscsi-target-cli/"&gt;iSCSI&lt;/a&gt; has been added to expose block storage to non-native clients like VMware or Windows. For the record, I have no personal experience with this feature (yet).&lt;/p&gt;
&lt;h3&gt;The Object Storage Daemon (OSD)&lt;/h3&gt;
&lt;p&gt;In this section we zoom in a little bit more into the technical details of Ceph.&lt;/p&gt;
&lt;p&gt;If you read about Ceph, you read a lot about the OSD or object storage daemon. This is a service (daemon) that runs on the storage node. The OSD is the actual workhorse of Ceph, it serves the data from the hard drive or ingests it and stores it on the drive. The OSD also assures storage redunancy, by replicating data to other OSDs based on the CRUSH map.&lt;/p&gt;
&lt;p&gt;To be precise: for every hard drive or solid state drive in the storage node, an OSD will be active. Does your storage node have 24 hard drives? Then it runs 24 OSDs. &lt;/p&gt;
&lt;p&gt;And when a drive goes down, the OSD will go down too and the monitor nodes will redistribute an update CRUSH map so the clients are aware and know where to get the data. The OSDs also respond to this update, because redundancy is lost, they may start to replicate non-redundant data to make it redundant again (across fewer nodes).&lt;/p&gt;
&lt;p&gt;When the drive is replaced, the cluster will 'self-heal'. This means that the new drive will be filled with data once again to make sure data is spread evenly across all drives within the cluster.&lt;/p&gt;
&lt;p&gt;So maybe it's interesting to realise that storage clients effectively directly talk to the OSDs that in turn talk to the individual hard drives. There aren't many components between the client and the data itself. &lt;/p&gt;
&lt;p&gt;&lt;img alt="cephdiagram01" src="https://louwrentius.com/static/images/cephdiagram01.png" /&gt;&lt;/p&gt;
&lt;h2&gt;Closing words&lt;/h2&gt;
&lt;p&gt;I hope that this blog post has helped you understand how Ceph works and why it is so interesting. If you have any questions or feedback please feel free to comment or email me.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:fn1"&gt;
&lt;p&gt;If you have a ton of high-volume sequential data storage traffic, you should realise that a single host with a ton of drives can easily saturate 10Gbit or theoretically even 40Gbit. I'm assuming 150 MB/s per hard drive. With 36 hard drives you would face 5.4 GB/s. Even if you only would run half that speed, you would need to bond multiple 10Gbit interfaces to sustain this load. Imagine the requirements for your core network. But it really depends on your workload. You will never reach this kind of throughput with a ton of random I/O unless you are using SSDs, for instance.&amp;#160;&lt;a class="footnote-backref" href="#fnref:fn1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:fn2"&gt;
&lt;p&gt;Please note that in production setups, it's the default to have a total of 3 instances of a data block. So that means 'the original' plus two extra copies. See also &lt;a href="http://docs.ceph.com/docs/jewel/rados/operations/pools/#set-the-number-of-object-replicas"&gt;this link&lt;/a&gt;. Thanks to sep76 from Reddit to &lt;a href="https://www.reddit.com/r/ceph/comments/98khhw/understanding_ceph_opensource_scalable_storage/e4ha7ss/"&gt;point out&lt;/a&gt; that the default is 3 instances of your data.&amp;#160;&lt;a class="footnote-backref" href="#fnref:fn2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="Ceph"/></entry><entry><title>Tracking down a faulty Storage Array Controller with ZFS</title><link href="https://louwrentius.com/tracking-down-a-faulty-storage-array-controller-with-zfs.html" rel="alternate"/><published>2016-12-15T12:00:00+01:00</published><updated>2016-12-15T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2016-12-15:/tracking-down-a-faulty-storage-array-controller-with-zfs.html</id><summary type="html">&lt;p&gt;One day, I lost two virtual machines on our DR environment after a storage vMotion.&lt;/p&gt;
&lt;p&gt;Further investigation uncovered that any storage vMotion of a virtual machine residing on our DR storage array would corrupt the virtual machine's disks.&lt;/p&gt;
&lt;p&gt;I could easily restore the affected virtual machines from backup and once …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One day, I lost two virtual machines on our DR environment after a storage vMotion.&lt;/p&gt;
&lt;p&gt;Further investigation uncovered that any storage vMotion of a virtual machine residing on our DR storage array would corrupt the virtual machine's disks.&lt;/p&gt;
&lt;p&gt;I could easily restore the affected virtual machines from backup and once that was done, continued my investigation. &lt;/p&gt;
&lt;p&gt;I needed a way to quickly verifying if a virtual hard drive of a virtual machine was corrupted after a storage vMotion to understand what the pattern was. &lt;/p&gt;
&lt;p&gt;First, I created a virtual machine based on Linux and installed ZFS. Then, I attached a second disk of about 50 gigabytes and formatted this drive with ZFS. Once I filled the drive using 'dd' to about 40 gigabytes I was ready to test.&lt;/p&gt;
&lt;p&gt;ZFS was chosen for testing purposes because it stores hashes of all blocks of data. This makes it very simple to quickly detect any data corruption. If the hash doesn't match the hash generated from the data, you just detected corruption. &lt;/p&gt;
&lt;p&gt;Other file systems don't store hashes and don't check for data corruption so they just trust the storage layer. It may take a while before you find out that data is corrupted. &lt;/p&gt;
&lt;p&gt;I performed a storage vMotion of this secondary disk towards different datastores and then ran a 'zfs scrub' to track down any corruption. This worked better than expected: the scrub command would hang if the drive was corrupted by the storage vMotion. The test virtual machine required a reboot and a reformat of the secondary hard drive with ZFS as the previous file system, including data got corrupted.&lt;/p&gt;
&lt;p&gt;After performing a storage vMotion on the drive in different directions, from different datastores to other datastores slowly a pattern emerged.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Storage vMotion corruption happened independent of the VMware ESXi host used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;a Storage vMotion never caused any issues when the disk was residing on our production storage array.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the corruption only happened when the virtual machine was stored on particular datastores on our DR storage array.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now it got really 'interesting'. The thing is that our DR storage array has two separate storage controllers running in active-active mode. However, the LUNs are always owned by a particular controller. Although the other controller can take over from the controller who 'owns' the LUNs in case of a failure, the owner will process the I/O when everything is fine. Particular LUNs are thus handled by a particular controller. &lt;/p&gt;
&lt;p&gt;So first I made a table where I listed the controllers and the LUNs it had ownership over, like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;            Owner       
Controller      a               b
            LUN001          LUN002
            LUN003          LUN004
            LUN005          LUN006
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then I started to perform Storage vMotions of the ZFS disk from one LUN to the other. After performing several test, the pattern became quite obvious.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;            LUN001  -&amp;gt;  LUN002  =   BAD
            LUN001  -&amp;gt;  LUN004  =   BAD
            LUN004  -&amp;gt;  LUN003  =   BAD
            LUN003  -&amp;gt;  LUN005  =   GOOD
            LUN005  -&amp;gt;  LUN001  =   GOOD
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I continued to test some additional permutations but it became clear that only LUNs owned by controller b caused problems. &lt;/p&gt;
&lt;p&gt;With the evidence in hand, I managed to convince our vendor support to replace storage controller b and that indeed resolved the problem. Data corruption due to a Storage vMotion never occurred after the controller was replaced. &lt;/p&gt;
&lt;p&gt;There is no need to name/shame the vendor in this regard. The thing is that all equipment can fail and what can happen will happen. What really counts is: are you prepared? &lt;/p&gt;</content><category term="Storage"/><category term="ZFS"/></entry><entry><title>RAID 5 is perfectly fine for home usage</title><link href="https://louwrentius.com/raid-5-is-perfectly-fine-for-home-usage.html" rel="alternate"/><published>2016-09-08T12:00:00+02:00</published><updated>2016-09-08T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2016-09-08:/raid-5-is-perfectly-fine-for-home-usage.html</id><summary type="html">&lt;p&gt;RAID 5 gets a lot of flak these days. You either run RAID 1, RAID 10 or you use RAID 6, but if you run RAID 5 you're told that you are a crazy person.&lt;/p&gt;
&lt;p&gt;Using RAID 5 is portrayed as an unreasonable risk to the availability of your data …&lt;/p&gt;</summary><content type="html">&lt;p&gt;RAID 5 gets a lot of flak these days. You either run RAID 1, RAID 10 or you use RAID 6, but if you run RAID 5 you're told that you are a crazy person.&lt;/p&gt;
&lt;p&gt;Using RAID 5 is portrayed as an unreasonable risk to the availability of your data. It is suggested that it is likely that you will lose your RAID array at some point. &lt;/p&gt;
&lt;p&gt;That's an unfair representation of the actual risk that surrounds RAID 5. As I see it, the scare about RAID 5 is totally blown out of proportion. &lt;/p&gt;
&lt;p&gt;I would argue that for small RAID arrays with a maximum of five to six drives, it's totally reasonable to use RAID 5 for your home NAS.&lt;/p&gt;
&lt;p&gt;As far as I can tell, the campaign against RAID 5 mainly started with &lt;a href="http://www.zdnet.com/article/why-raid-5-stops-working-in-2009/"&gt;this article from zdnet&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;As you know RAID 5 can tollerate a single drive failure. If a second drive dies and the first drive was not yet replaced or rebuild, you lose all contents of the array. &lt;/p&gt;
&lt;p&gt;In the article the author argues that because drives become bigger but not more reliable, the risk of losing a second drive during a rebuild is so high that running RAID 5 is becoming risky. &lt;/p&gt;
&lt;p&gt;You don't need a second drive failure for you to lose your data. A bad sector, also known as an Unrecoverable Read Error (URE), can also cause problems during a rebuild. Depending on the RAID implementation, you may lose some files or the entire array. &lt;/p&gt;
&lt;p&gt;The author calculates and argues that the risk of such a bad sector or URE is so high with modern high-capacity drives, that this risk of a second drive failure during rebuild is almost unavoidable. &lt;/p&gt;
&lt;p&gt;Most drives have a URE specification of 1 bit error in 12.5 TB of data (10^14). That number is used as an absolute, it's what drives do experience in our daily lives, but that's not true.&lt;/p&gt;
&lt;p&gt;It's a worst-case number. You will see a read error in &lt;em&gt;at-most&lt;/em&gt; 10^14 bits, but in practice drives are way more reliable. &lt;/p&gt;
&lt;p&gt;I run ZFS on my &lt;a href="https://louwrentius.com/74tb-diy-nas-based-on-zfs-on-linux.html"&gt;71 TB ZFS NAS&lt;/a&gt; and I scrub from time to time. &lt;/p&gt;
&lt;p&gt;If that worst-case number were 'real', I would have caught some data errors by now. However, in line with my personal experience, ZFS hasn't corrected a single byte since the system came online a few years ago. &lt;/p&gt;
&lt;p&gt;And I've performed so many scrubs that my system has read over a &lt;em&gt;petabyte&lt;/em&gt; of data. No silent data corruption, no regular bad sectors.&lt;/p&gt;
&lt;p&gt;It seems to me that all those risk aren't nearly as high as it seems.&lt;/p&gt;
&lt;p&gt;I would argue that choosing RAID-5/Z in the right circumstances is reasonable.
RAID-6 is clearly safer than RAID-5 as you can survive the loss of two drives instead of a single drive, but that doesn't mean that RAID-5 is unsafe.&lt;/p&gt;
&lt;p&gt;If you are going to run a RAID 5 array, make sure you run a scrub or patrol read or whatever the name is that your RAID solution uses. A scrub is nothing more than attempt to try and read all data from disk.&lt;/p&gt;
&lt;p&gt;Scrubbing allows detection of bad sectors in advance, so you can replace drives before they cause real problems (like failing during a rebuild). &lt;/p&gt;
&lt;p&gt;If you keep the number of drives in a RAID-5 array low, maybe at most 5 or 6, I think for home users, who need to find a balance between cost and capacity, RAID-5 is an acceptable option.&lt;/p&gt;
&lt;p&gt;And remember: if you care about your data, you need a backup anyway.&lt;/p&gt;
&lt;p&gt;This topic was also discussed on &lt;a href="https://www.reddit.com/r/DataHoarder/comments/515l3t/the_hate_raid5_gets_is_uncalled_for/"&gt;reddit&lt;/a&gt;.&lt;/p&gt;</content><category term="Storage"/><category term="RAID"/></entry><entry><title>ZFS: resilver performance of various RAID schemas</title><link href="https://louwrentius.com/zfs-resilver-performance-of-various-raid-schemas.html" rel="alternate"/><published>2016-01-31T12:00:00+01:00</published><updated>2016-01-31T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2016-01-31:/zfs-resilver-performance-of-various-raid-schemas.html</id><summary type="html">&lt;p&gt;When building your own &lt;em&gt;DIY home&lt;/em&gt; NAS, it is important that you simulate and test drive failures before you put your important data on it. It makes sense to know what to do in case a drive needs to be replaced. I also recommend putting a substantial amount of data …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When building your own &lt;em&gt;DIY home&lt;/em&gt; NAS, it is important that you simulate and test drive failures before you put your important data on it. It makes sense to know what to do in case a drive needs to be replaced. I also recommend putting a substantial amount of data on your NAS and see how long a resilver takes just so you know what to expect. &lt;/p&gt;
&lt;p&gt;There are many reports of people building their own (ZFS-based) NAS who found out after a drive failure that resilvering would take days. If your chosen redundancy level for the VDEV would not protect against a second drive failure in the same VDEV (Mirror, RAID-Z) things may get scary. Especially because drives are quite bussy rebuilding data and the extra load on the remaining drives may increase the risk of a second failure.&lt;/p&gt;
&lt;p&gt;The chosen RAID level for your VDEV, has an impact on the resilver performance.
You may chose to accept lower resilver performance in exchange for additional redundancy (RAID-Z2, RAID-Z3).&lt;/p&gt;
&lt;p&gt;I did wonder though how much those resilver times would differ between the various RAID levels. This is why I decided to run some tests to get some numbers.&lt;/p&gt;
&lt;h3&gt;Test hardware&lt;/h3&gt;
&lt;p&gt;I've used some &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;test equipment&lt;/a&gt; running Debian Jessie + ZFS on Linux. The hardware is rather old and the CPU may have an impact on the results. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;CPU : Intel(R) Core(TM)2 Duo CPU     E7400  @ 2.80GHz
RAM : 8 GB
HBA : HighPoint RocketRaid 2340 (each drive in a jbod)
Disk: Samsung Spinpoint F1 - 1 TB - 7200 RPM ( 12 x )
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Test method&lt;/h3&gt;
&lt;p&gt;I've created a &lt;a href="https://github.com/louwrentius/zfs-resilver-benchmark"&gt;script&lt;/a&gt; that runs all tests automatically. This is how the script works:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create pool + vdev(s).&lt;/li&gt;
&lt;li&gt;Write data on pool ( XX % of pool capacity)&lt;/li&gt;
&lt;li&gt;Replace arbitrary drive with another one.&lt;/li&gt;
&lt;li&gt;Wait for resilver to complete.&lt;/li&gt;
&lt;li&gt;Log resilver duration o csv file. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For each test, I fill the pool up to 25% with data before I measure resilver performance. &lt;/p&gt;
&lt;h3&gt;Caveats&lt;/h3&gt;
&lt;p&gt;The problem with the pool only being filled for 25% is that drives are fast at the start, but their performance deteriorates significantly as they fill up. This means that you cannot extrapolate the results and calculate resilver times for 50% or 75% pool usage, the numbers are likely worse than that. &lt;/p&gt;
&lt;p&gt;I should run the test again with 50% usage to see if we can demonstrate this effect. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Beware&lt;/em&gt; that this test method is probably only suitable for DIY home NAS builds. Production file systems used within businesses may be way more fragmented and I've been told that this could slow down resilver times dramatically.&lt;/p&gt;
&lt;h3&gt;Test result (lower is better)&lt;/h3&gt;
&lt;p&gt;&lt;img alt="resilver graph" src="https://louwrentius.com/static/images/zfs-resilver-benchmark01.png" /&gt;&lt;/p&gt;
&lt;p&gt;The results can only be used to demonstrate the relative resilver performance differences of the various RAID levels and disk counts per VDEV. &lt;/p&gt;
&lt;p&gt;You should not expect the same performance results for your own NAS as the hardware probably differs significantly from my test setup.&lt;/p&gt;
&lt;h3&gt;Observations&lt;/h3&gt;
&lt;p&gt;I think the following observations can be made: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Mirrors resilver the fastest even if the number of drives involved is increased.&lt;/li&gt;
&lt;li&gt;RAID-Z resilver performance is on-par with using mirrors when using 5 disks or less.&lt;/li&gt;
&lt;li&gt;RAID-Zx resilver performance deteriorates as the number of drives in a VDEV increases.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I find it interesting that with smaller number of drives in a RAID-Z VDEV, rebuild performance is roughly on par with a mirror setup. If long rebuild times would scare you away from using RAID-Z, maybe it should not. There may be other reasons why you might shy away from RAID-Z, but this doesn't seem one of them.&lt;/p&gt;
&lt;p&gt;RAID-Z2 is often very popular amongst home NAS builders, as it offers a very nice balance between capacity and redundancy. Wider RAID-Z2 VDEVs are more space efficient, but it is also clear that resilver operations take longer. Because RAID-Z2 can tollerate the loss of two drives, I think longer resilver times seem like a reasonable tradeoff. &lt;/p&gt;
&lt;p&gt;It is clear that as you put more disks in a single RAID-Zx VDEV, rebuild times increase. This can be used as an argument to keep the number of drives per VDEV 'reasonable' or to switch to RAID-Z3. &lt;/p&gt;
&lt;h4&gt;25% vs 50% pool usage&lt;/h4&gt;
&lt;p&gt;To me, there's nothing special to see here. The resilver times are on average slightly worse than double the 25% resilver durations. As disks performance start to deteriorate as they fill up (inner tracks are shorter/slower) sequential performance drops. So this is why I would explain the results are slightly worse than perfect linear scaling. &lt;/p&gt;
&lt;h4&gt;Final words&lt;/h4&gt;
&lt;p&gt;I hope this benchmark is of interest to anyone and more importantly, you can run your own by using the aforementioned &lt;a href="https://github.com/louwrentius/zfs-resilver-benchmark"&gt;script&lt;/a&gt;. If you ever want to run your own benchmarks, expect the script to run for days. Leave a comment if you have questions or remarks about these test results or the way testing is done. &lt;/p&gt;</content><category term="Storage"/><category term="ZFS"/></entry><entry><title>The 'hidden' cost of using ZFS for your home NAS</title><link href="https://louwrentius.com/the-hidden-cost-of-using-zfs-for-your-home-nas.html" rel="alternate"/><published>2016-01-02T12:00:00+01:00</published><updated>2016-01-02T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2016-01-02:/the-hidden-cost-of-using-zfs-for-your-home-nas.html</id><summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update December 2023:&lt;/strong&gt;
In June, it was &lt;a href="https://github.com/openzfs/zfs/pull/12225#issuecomment-1610169213"&gt;announced&lt;/a&gt; that iXsystems would sponsor implementing the VDEV expansion feature. A new &lt;a href="https://github.com/openzfs/zfs/pull/15022"&gt;pr&lt;/a&gt; has been created for this effort. The feature was merged into the code base, but may not be available to the general public before the &lt;a href="https://github.com/openzfs/zfs/pull/15022#issuecomment-1802428899"&gt;end of 2024&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;**Update …&lt;/p&gt;</summary><content type="html">&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update December 2023:&lt;/strong&gt;
In June, it was &lt;a href="https://github.com/openzfs/zfs/pull/12225#issuecomment-1610169213"&gt;announced&lt;/a&gt; that iXsystems would sponsor implementing the VDEV expansion feature. A new &lt;a href="https://github.com/openzfs/zfs/pull/15022"&gt;pr&lt;/a&gt; has been created for this effort. The feature was merged into the code base, but may not be available to the general public before the &lt;a href="https://github.com/openzfs/zfs/pull/15022#issuecomment-1802428899"&gt;end of 2024&lt;/a&gt;.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;**Update August 2025: **
ZFS RAIDZ VDEV expansion has been released since &lt;a href="https://github.com/openzfs/zfs/releases/tag/zfs-2.3.0"&gt;OpenZFS release 2.3.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please note that an important limitation discussed in this article - the inability to expand VDEVs - has been lifted. &lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;Many home NAS builders consider using ZFS for their file system. But there is a caveat with ZFS that people should be aware of.&lt;/p&gt;
&lt;p&gt;Although ZFS is free software, implementing ZFS is not free. The key issue is that expanding capacity with ZFS is more expensive compared to legacy RAID solutions.&lt;/p&gt;
&lt;p&gt;With ZFS, you either have to buy all storage you expect to need upfront, or you will be wasting a few hard drives on redundancy you don't need.&lt;/p&gt;
&lt;p&gt;This fact is often overlooked, but it's very important to take it in consideration when planning a NAS build.&lt;/p&gt;
&lt;p&gt;Other software RAID solutions like Linux MDADM lets you grow an existing RAID array with one disk at a time. This is also true for many hardware-based RAID solutions&lt;sup id="fnref:dead"&gt;&lt;a class="footnote-ref" href="#fn:dead"&gt;1&lt;/a&gt;&lt;/sup&gt;. This is ideal for home users because you can expand on a per-need basis. &lt;/p&gt;
&lt;p&gt;ZFS does &lt;strong&gt;not&lt;/strong&gt; allow this!&lt;/p&gt;
&lt;p&gt;To understand why using ZFS may cost you extra money, we will dig a little bit into ZFS itself.&lt;/p&gt;
&lt;h2&gt;Quick recap of ZFS&lt;/h2&gt;
&lt;p&gt;The schema below illustrates the architecture of ZFS. There are a few things you should take away from it. &lt;/p&gt;
&lt;p&gt;&lt;img alt="zfs" src="https://louwrentius.com/static/images/zfs-overview.png" /&gt;&lt;/p&gt;
&lt;p&gt;The main takeaway of this picture is that your ZFS pool and thus your file system is based on one or more VDEVs. And those VDEVs contain the actual hard drives.&lt;/p&gt;
&lt;p&gt;Fault-tolerance or redundancy is addressed within a VDEV. A VDEV is either a mirror (RAID-1),  RAIDZ (RAID-5) or RAIDZ2 (RAID-6)&lt;sup id="fnref:z3"&gt;&lt;a class="footnote-ref" href="#fn:z3"&gt;2&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;So it's important to understand that a ZFS &lt;em&gt;pool&lt;/em&gt; itself is &lt;em&gt;not fault-tolerant&lt;/em&gt;. If you lose a single VDEV within a pool, you lose the whole pool. You lose the pool, all data is lost.&lt;/p&gt;
&lt;h2&gt;You can't add hard drives to a VDEV&lt;/h2&gt;
&lt;p&gt;Now it's very important to understand that you &lt;em&gt;cannot add hard drives to a VDEV&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;This is the key limitation of ZFS as seen from the perspective of home NAS builders. &lt;/p&gt;
&lt;p&gt;To expand the storage capacity of your pool, you need to add extra VDEVs. And because each VDEV needs to take care of its own redundancy, you also need to buy extra drives for parity.&lt;/p&gt;
&lt;p&gt;I will quickly add that there is a way out: replace every hard drive in the VDEV, one by one, with a higher capacity hard drive. You will have to 'rebuild' or 'resilver' the VDEV after each replacement, but it will work, although it's a bit cumbersome and quite expensive.&lt;/p&gt;
&lt;p&gt;So back to the topic at hand: what does this limitation mean in real life? I'll give an example. &lt;/p&gt;
&lt;p&gt;Let's say you plan on building a &lt;a href="https://louwrentius.com/zfs-performance-on-hp-proliant-microserver-gen8-g1610t.html"&gt;small NAS with a capacity of four drives&lt;/a&gt;. Please don't create a three-drive RAID-Z thinking you can just add the fourth drive when you need to, because that's &lt;em&gt;not&lt;/em&gt; possible.&lt;/p&gt;
&lt;p&gt;In this example, you would be better off buying the fourth drive upfront and create a four-drive RAID-Z. This is an example where you are forced to buy the extra space you don't need yet upfront because expanding is otherwise not possible.&lt;/p&gt;
&lt;p&gt;You could have expanded your pool with another VDEV consisting of a minimum of three drives (if you run RAID-Z) but the chassis has only room for one extra drive so that doesn't work.&lt;/p&gt;
&lt;h2&gt;Planning your ZFS Build with the VDEV limitation in mind&lt;/h2&gt;
&lt;p&gt;Many home NAS builders use RAID-6 (RAID-Z2) for their builds, because of the extra redundancy. This makes sense because a double drive failure is not something unheard of, especially during rebuilds where all drives are being taxed quite heavily for many hours. &lt;/p&gt;
&lt;p&gt;I personally would recommend running RAID-Z2 over RAID-Z1 if you go over five to six drives and to spend the extra money on the additional hard drive it requires. Actually, With RAID-Z2 or RAID-6, I think it's perfectly reasonable to run a single VDEV at home with up to 12 drives&lt;sup id="fnref:san"&gt;&lt;a class="footnote-ref" href="#fn:san"&gt;3&lt;/a&gt;&lt;/sup&gt;. &lt;/p&gt;
&lt;p&gt;With RAID-Z2 however, the 'ZFS tax' is even more clearly visible. By having to add an additional VDEV, you will also lose two drives due to parity overhead.&lt;/p&gt;
&lt;p&gt;&lt;img alt="zfs2" src="https://louwrentius.com/static/images/zfs-2vdev.png" /&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Please note that the 'yellow' drives mark the parity/redundancy overhead. It does not mark where parity data lives (it's striped across all drives).&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Let's illustrate the above picture with an example. Your NAS chassis can hold a maximum of twelve drives. You start out with six drives in a RAID-Z2. At some point you want to expand. The cheapest option is to expand with another RAID-Z2 consisting of four drives (minimum size of a RAID-Z2 VDEV). &lt;/p&gt;
&lt;p&gt;With a cost of $150 per hard drive&lt;sup id="fnref:example"&gt;&lt;a class="footnote-ref" href="#fn:example"&gt;4&lt;/a&gt;&lt;/sup&gt;, expanding the capacity of your pool will cost you $600 instead of $150 (single drive) and $300 dollar of the $600 (50%) is wasted on redundancy you don't really need.&lt;/p&gt;
&lt;p&gt;Furthermore, you can no longer expand your pool, so the remaining two drive slots are 'wasted'&lt;sup id="fnref:no"&gt;&lt;a class="footnote-ref" href="#fn:no"&gt;5&lt;/a&gt;&lt;/sup&gt;. You end up with a maximum of ten drives.&lt;/p&gt;
&lt;p&gt;In this example, to make use of the drive capacity of your NAS chassis, you should expand with another six hard drives. That would cost you $900 and $300 of that $900 (33%) is wasted on redundancy. This is illustrated above. &lt;/p&gt;
&lt;p&gt;Storage-wise it's more efficient to expand with six drives instead of four. But it will cost you another $300 to expand, paying for storage you may not immediately need. &lt;/p&gt;
&lt;p&gt;But both options aren't that efficient. Because you end up using four drives for parity where two would - in my view - be sufficient. &lt;/p&gt;
&lt;p&gt;So, if you want to get the most capacity out of that chassis, and the most space per dollar, your only option is to buy all twelve drives upfront and create a single RAID-Z2 consisting of twelve drives. &lt;/p&gt;
&lt;p&gt;&lt;img alt="zfs1" src="https://louwrentius.com/static/images/zfs-1vdev.png" /&gt;&lt;/p&gt;
&lt;p&gt;Buying all drives upfront is expensive and you may only benefit from that extra space years down the road. &lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;So I hope this example clearly illustrates the issue at hand. With ZFS, you either need to buy all storage upfront or you will lose hard drives to redundancy you don't need, reducing the maximum storage capacity of your NAS.&lt;/p&gt;
&lt;p&gt;You have to decide what your needs are. ZFS is an awesome file system that offers you way better data integrity protection than other file system + RAID solution combination. &lt;/p&gt;
&lt;p&gt;But implementing ZFS has a certain 'cost'. You must decide if ZFS is worth it for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update April 2023:&lt;/strong&gt;
It has been fairly quiet since the announcement of RAIDZ expansion.
The Github &lt;a href="https://github.com/openzfs/zfs/pull/12225"&gt;PR&lt;/a&gt; about this feature is rather stale and people are wondering what the status is and what the plans are. Meanwhile, FreeBSD has announced In February 2023 that they suspect to integrate RAIDZ expansion by Q3. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update June 2021&lt;/strong&gt;|
It seems that &lt;a href="https://github.com/openzfs/zfs/pull/12225"&gt;RAIDZ expansion is now being worked on&lt;/a&gt;. It will probably be available somewhere around &lt;a href="https://arstechnica.com/gadgets/2021/06/raidz-expansion-code-lands-in-openzfs-master/"&gt;August 2022&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I have written a &lt;a href="https://louwrentius.com/zfs-raidz-expansion-is-awesome-but-has-a-small-caveat.html"&gt;blogpost&lt;/a&gt; about this new feature. The bad news is that adding drives to an existing vdev may accrue some overhead, but the good news is that this overhead can be recovered. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Update October 2017&lt;/strong&gt; |
Please note that RAIDZ expansion is &lt;a href="https://twitter.com/OpenZFS/status/921042446275944448?s=09"&gt;under development&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote class="twitter-tweet" data-lang="en"&gt;&lt;p lang="en" dir="ltr"&gt;RAIDZ expansion (most requested ZFS feature ever?) is coming, courtesy of &lt;a href="https://twitter.com/freebsdfndation?ref_src=twsrc%5Etfw"&gt;@freebsdfndation&lt;/a&gt;. Sneak preview at OpenZFS DevSummit!&lt;/p&gt;&amp;mdash; OpenZFS (@OpenZFS) &lt;a href="https://twitter.com/OpenZFS/status/921042446275944448?ref_src=twsrc%5Etfw"&gt;October 19, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;hr&gt;

&lt;h2&gt;Addressing some feedback&lt;/h2&gt;
&lt;p&gt;I found out that my article was &lt;a href="https://youtu.be/B_OEUfOmU8w?t=11m55s"&gt;discussed on a vodcast of BSDNOW&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This article also got some attention on &lt;a href="https://news.ycombinator.com/item?id=10886068"&gt;hacker news&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To me, some of the feedback is not 'wrong' but feels rather disingenuous or not relevant for the intended audience of this article. I have provided the links so you can make up your own mind.&lt;/p&gt;
&lt;p&gt;This article has a particular user group in mind so you really should think about how much their needs align with yours.&lt;/p&gt;
&lt;h2&gt;You are steering people away from ZFS&lt;/h2&gt;
&lt;p&gt;No I don't and this is not my intention. I run ZFS myself on two servers. I do feel that sometimes the downsides of ZFS are wiped under the rug and we should be very open and clear about them towards people seeking advice.&lt;/p&gt;
&lt;h3&gt;Use mirrors not RAID-Z(2/3)!&lt;/h3&gt;
&lt;p&gt;Doesn't make much sense to me for home NAS builders.&lt;/p&gt;
&lt;h4&gt;Using mirrors is wasting space&lt;/h4&gt;
&lt;p&gt;Advising people to use mirrors instead of RAID-Z(2/3) I do find a little bit disingenuous. Because you are throwing away 50% of your disk capacity. With RAIDZ you 'lose' 33% for three drives, 25% for four drives. If we look at RAIDZ2, we would 'lose' 33% for six drives, 25% for eight drives and only 20% for ten drives. &lt;/p&gt;
&lt;p&gt;In the end, you are waisting multiple drives worth of storage capacity depending on the number of drives in your pool. &lt;/p&gt;
&lt;h4&gt;Adding mirrors with larger drives&lt;/h4&gt;
&lt;p&gt;As time goes by, larger disks become cheaper. So it could make sense to expand your pool with mirrors based on bigger drives than the original drives you started out on. The size of your pool would increase. However, it's still only 50% space efficient. &lt;/p&gt;
&lt;h4&gt;Random I/O performance is better&lt;/h4&gt;
&lt;p&gt;Using mirrors is running RAID 10. Yes you can expand your pool with two drives at a time, and you gain better random I/O performance. However, the large majority of home NAS builders don't care about random I/O performance. You just care if you can saturate gigabit and have one big pool of storage. In that case, you don't need the random IOPs. &lt;/p&gt;
&lt;p&gt;If you run some VMs from your storage that require high storage performance, it's an entirely different matter. But I expect that most DIY NAS builders just want some storage to put a ton of data on and nothing more.&lt;/p&gt;
&lt;h4&gt;RAIDZ2 is more reliable than using mirrors&lt;/h4&gt;
&lt;p&gt;The redundancy of RAIDZ2 beats using mirrors. (If during a rebuild the surviving member of a mirror fails (the one disk in the pool that is taxed the most during rebuild) you lose your pool. With RAIDZ2 any second drive can fail and you are still OK.&lt;/p&gt;
&lt;p&gt;There is only one 'upside' regarding mirrors that is discussed in the next section.&lt;/p&gt;
&lt;h4&gt;Mirror rebuild times are better&lt;/h4&gt;
&lt;p&gt;The only upside of using mirrors is that in the event a disk has failed and the new disk is being 'resilvered' it is reported that those rebuilds tend to be faster than if you use RAID-Z(2/3). I think this is no different from legacy RAID, where the main difference with ZFS is that ZFS only rebuilds actual data, not the entire disk.&lt;/p&gt;
&lt;h3&gt;ZFS rebuilds are faster&lt;/h3&gt;
&lt;p&gt;This is indeed a benefit of ZFS. The question is how relevant it is for you.&lt;/p&gt;
&lt;p&gt;ZFS only rebuilds data. Legacy RAID just rebuilds every 'bit' on a drive. The latter takes longer than the former. So with legacy RAID, rebuild times depend on the size of a single drive, not on the number of drives in the array, no matter how much data you have stored on your array.&lt;/p&gt;
&lt;p&gt;My old 18 TB server was based on a single twenty-drive RAID 6 using MDADM. It took 5 hours to rebuild a 1 TB drive. If you would have used 4 TB drives, it would have taken 20 hours if I'm allowed to extrapolate. With ZFS - if you would have been using only 50% of capacity - those rebuild times would have been half of this.  &lt;/p&gt;
&lt;p&gt;Personally with RAID6 or with RAIDZ2, rebuild times aren't that a big of a deal as you can lose a second drive and still be safe.&lt;/p&gt;
&lt;h3&gt;Just replace existing drives with bigger ones!&lt;/h3&gt;
&lt;p&gt;I did briefly touch this option in the article above. I will address it again. The problem with this approach is twofold. First, you can't expand storage capacity as you need it. You need to replace &lt;em&gt;all&lt;/em&gt; existing drives with larger ones. &lt;/p&gt;
&lt;p&gt;The procedure itself is also a bit cumbersome and time intensive. You need to replace each drive one by one. And every time, you need to 'resilver' your VDEV. Only when all drives have been replaced you will be able to grow the size of your pool.&lt;/p&gt;
&lt;p&gt;If you are OK with this approach - and people have used it - it is a way to work around the 'ZFS-tax'. &lt;/p&gt;
&lt;h3&gt;Not using ZFS is putting your data at great risk!&lt;/h3&gt;
&lt;p&gt;The BSDNOW podcasts seems to agree with me that if you want true data safety, this 'ZFS-tax' is just the price you have to pay. Either you go with mirrors or you accept the extra parity redundancy. &lt;/p&gt;
&lt;p&gt;It is not my goal to steer you away from ZFS. The above is true. ZFS offers something no other (stable) file system currently offers to home NAS builders. But at a cost.&lt;/p&gt;
&lt;p&gt;The thing is that I find it perfectly reasonable for home NAS users to just buy a Synology, QNAP or some ready-made NAS from another quality brand. That's what the majority of people do and I think it's a reasonable option. I don't think you are taking crazy risks if you would do so.&lt;/p&gt;
&lt;p&gt;If you do build your own &lt;em&gt;home&lt;/em&gt; NAS, it's &lt;em&gt;reasonable&lt;/em&gt; to accept the 'risk' of using Windows with storage spaces or hardware RAID. Or using Linux with MDADM or hardware RAID. I would say: &lt;em&gt;ZFS is clearly technically the better option&lt;/em&gt;, but those 'legacy' options are not so bad that you are taking unreasonable risks with your data. &lt;/p&gt;
&lt;p&gt;So using ZFS is the &lt;em&gt;better&lt;/em&gt; option, it's up to you and your particular needs and circumstances to decide if using ZFS is worth it for you.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:dead"&gt;
&lt;p&gt;I believe hardware-based RAID is 100% dead, especially with SSDs but historically speaking hardare RAID allowed for flexible expansion.&amp;#160;&lt;a class="footnote-backref" href="#fnref:dead" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:z3"&gt;
&lt;p&gt;It can even use tripple parity (RAID-Z3) but I doubt many of you will ever need that.&amp;#160;&lt;a class="footnote-backref" href="#fnref:z3" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:san"&gt;
&lt;p&gt;For my own 71 TB storage NAS I decided at that time to run with an eighteen-disk VDEV plus a six-disk VDEV. Not standard, but I decided that I accept the risk.&amp;#160;&lt;a class="footnote-backref" href="#fnref:san" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:example"&gt;
&lt;p&gt;Just an example for illustration purposes.&amp;#160;&lt;a class="footnote-backref" href="#fnref:example" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:no"&gt;
&lt;p&gt;Expanding with a VDEV consisting of a mirrored pair is technically possible but it breaks the RAID-Z2 redundancy. It doesn't make much sense to me.&amp;#160;&lt;a class="footnote-backref" href="#fnref:no" title="Jump back to footnote 5 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><category term="Storage"/><category term="ZFS"/></entry><entry><title>ZFS performance on HP Proliant Microserver Gen8 G1610T</title><link href="https://louwrentius.com/zfs-performance-on-hp-proliant-microserver-gen8-g1610t.html" rel="alternate"/><published>2015-08-14T12:00:00+02:00</published><updated>2015-08-14T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2015-08-14:/zfs-performance-on-hp-proliant-microserver-gen8-g1610t.html</id><summary type="html">&lt;p&gt;I think the HP Proliant Microserver Gen8 is a very interesting little box if you want to build your own ZFS-based NAS. The benchmarks I've performed seem to confirm this. &lt;/p&gt;
&lt;p&gt;The Microserver Gen8 has nice features such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;iLO (KVM over IP with dedicated network interface)&lt;/li&gt;
&lt;li&gt;support for ECC memory …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;I think the HP Proliant Microserver Gen8 is a very interesting little box if you want to build your own ZFS-based NAS. The benchmarks I've performed seem to confirm this. &lt;/p&gt;
&lt;p&gt;The Microserver Gen8 has nice features such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;iLO (KVM over IP with dedicated network interface)&lt;/li&gt;
&lt;li&gt;support for ECC memory&lt;/li&gt;
&lt;li&gt;2 x Gigabit network ports&lt;/li&gt;
&lt;li&gt;Free PCIe slot (half-height)&lt;/li&gt;
&lt;li&gt;Small footprint&lt;/li&gt;
&lt;li&gt;Fairly silent&lt;/li&gt;
&lt;li&gt;good build quality&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Microserver Gen8 can be a better solution than the offerings of - for example - Synology or QNAP because you can create a more reliable system based on ECC-memory and ZFS. &lt;/p&gt;
&lt;p&gt;&lt;img alt="gen8" src="https://louwrentius.com/static/images/gen8server.png" /&gt;&lt;/p&gt;
&lt;p&gt;Please note that the G1610T version of the Microserver Gen8 does not ship with a DVD/CD drive as depicted in the image above.&lt;/p&gt;
&lt;p&gt;The Gen8 can be found fairly cheap on the European market at around 240 Euro including taxes and if you put in an extra 8 GB of memory on top of the 2 GB installed you have a total of 10 GB, which is more than enough to support ZFS.&lt;/p&gt;
&lt;p&gt;The Gen8 has room for 4 x 3.5" hard drives so with todays large disk sizes you can pack quite a bit of storage inside this compact machine. &lt;/p&gt;
&lt;p&gt;&lt;img alt="gen82" src="https://louwrentius.com/static/images/gen8server2.png" /&gt;&lt;/p&gt;
&lt;h3&gt;Netto storage capacity:&lt;/h3&gt;
&lt;p&gt;This table gives you a quick overview of the netto storage capacity you would get depending on the chosen drive size and redundancy.&lt;/p&gt;
&lt;table border="0" cellpadding="10" cellspacing="2"&gt;
&lt;tr&gt;&lt;th&gt;Drive size&lt;/th&gt;&lt;th align='right'&gt;RAIDZ&lt;/th&gt;&lt;th align='right'&gt;RAIDZ2 or Mirror&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3 TB&lt;/td&gt;&lt;td align='right'&gt; 9 TB&lt;/td&gt;&lt;td align='right'&gt; 6 TB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4 TB&lt;/td&gt;&lt;td align='right'&gt;12 TB&lt;/td&gt;&lt;td align='right'&gt; 8 TB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;6 TB&lt;/td&gt;&lt;td align='right'&gt;18 TB&lt;/td&gt;&lt;td align='right'&gt;12 TB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8 TB&lt;/td&gt;&lt;td align='right'&gt;24 TB&lt;/td&gt;&lt;td align='right'&gt;16 TB&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

&lt;h3&gt;Boot device&lt;/h3&gt;
&lt;p&gt;If you want to use all four drive slots for storage, you need to boot this machine from either the fifth internal SATA port, the internal USB 2.0 port or the microSD card slot.&lt;/p&gt;
&lt;p&gt;The fifth SATA port is not bootable if you disable the on-board RAID controller and run in pure AHCI mode. This mode is probably the best mode for ZFS as there seems to be no RAID controller firmware active between the disks and ZFS. However, only the four 3.5" drive bays are bootable.&lt;/p&gt;
&lt;p&gt;The fifth SATA port is bootable if you configure SATA to operate in Legacy mode. This is not recommended as you lose the benefits of AHCI such as hot-swap of disks and there are probably also performance penalties. &lt;/p&gt;
&lt;p&gt;The fifth SATA port is also bootable if you &lt;em&gt;enable&lt;/em&gt; the on-board RAID controller, but do &lt;em&gt;not&lt;/em&gt; configure any RAID arrays with the drives you plan to use with ZFS (Thanks Mikko Rytilahti). You do need to put the boot drive in a RAID volume in order to be able to boot from the fifth SATA port.&lt;/p&gt;
&lt;p&gt;The unconfigured drives will just be passed as AHCI devices to the OS and thus can be used in your ZFS array. The big question here is what happens if you encounter read errors or other drive problems that ZFS could handle, but would be a reason for the RAID controller to kick a drive off the SATA bus. I have no information on that.&lt;/p&gt;
&lt;p&gt;I myself used an old 2.5" hard drive with a SATA-to-USB converter which I stuck  in the case (use double-sided tape or velcro to mount it to the PSU). Booting from USB stick is also an option, although a regular 2.5" hard drive or SSD is probably more reliable (flash wear) and faster.&lt;/p&gt;
&lt;h3&gt;Boot performance&lt;/h3&gt;
&lt;p&gt;The Microserver Gen8 takes about 1 minute and 50 seconds just to pass the BIOS boot process and start booting the operating system (you will hear a beep).&lt;/p&gt;
&lt;h3&gt;Test method and equipment&lt;/h3&gt;
&lt;p&gt;I'm running Debian Jessie with the latest stable ZFS-on-Linux 0.6.4.
Please note that reportedly FreeNAS also runs perfectly fine on this box.&lt;/p&gt;
&lt;p&gt;I had to run my tests with the disk I had available: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@debian:~# show disk -sm
-----------------------------------
| Dev | Model              | GB   |   
-----------------------------------
| sda | SAMSUNG HD103UJ    | 1000 |   
| sdb | ST2000DM001-1CH164 | 2000 |   
| sdc | ST2000DM001-1ER164 | 2000 |   
| sdd | SAMSUNG HM250HI    | 250  |   
| sde | ST2000DM001-1ER164 | 2000 |   
-----------------------------------
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The 250 GB is a portable disk connected to the internal USB port. It is used as the OS boot device. The other disks, 1 x 1 TB and 3 x 2 TB are put together in a single RAIDZ pool, which results in 3 TB of storage. &lt;/p&gt;
&lt;h3&gt;Tests with 4-disk RAIDZ VDEV&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@debian:~# zfs list
NAME       USED  AVAIL  REFER  MOUNTPOINT
testpool  48.8G  2.54T  48.8G  /testpool
root@debian:~# zpool status
  pool: testpool
 state: ONLINE
  scan: none requested
config:

    NAME                        STATE     READ WRITE CKSUM
    testpool                    ONLINE       0     0     0
      raidz1-0                  ONLINE       0     0     0
        wwn-0x50000f0008064806  ONLINE       0     0     0
        wwn-0x5000c5006518af8f  ONLINE       0     0     0
        wwn-0x5000c5007cebaf42  ONLINE       0     0     0
        wwn-0x5000c5007ceba5a5  ONLINE       0     0     0

errors: No known data errors
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Because a NAS will face data transfers that are sequential in nature, I've done some tests with 'dd' to measure this performance. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Read performance:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;root@debian:~# dd if=/testpool/test.bin of=/dev/null bs=1M   &lt;br /&gt;
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 162.429 s, 323 MB/s&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Write performance:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;root@debian:~# dd if=/dev/zero of=/testpool/test.bin bs=1M count=50000 conv=sync
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 169.572 s, 309 MB/s&lt;/p&gt;
&lt;h3&gt;Test with 3-disk RAIDZ VDEV&lt;/h3&gt;
&lt;p&gt;After the previous test I wondered what would happen if I would exclude the older 1 TB disk and create a pool with just the 3 x 2 TB drives. This is the result:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Read performance:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;root@debian:~# dd if=/testpool/test.bin of=/dev/null bs=1M conv=sync 
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 149.509 s, 351 MB/s&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Write performance:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;root@debian:~# dd if=/dev/zero of=/testpool/test.bin bs=1M count=50000 conv=sync
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 144.832 s, 362 MB/s&lt;/p&gt;
&lt;p&gt;The performance is clearly better even there's one disk less in the VDEV.
I would have liked to test with an additional 2 TB drive what kind of performance would be achieved with four drives but I only have three. &lt;/p&gt;
&lt;p&gt;The result does show that the pool is more than capable of sustaining gigabit network transfer speeds. &lt;/p&gt;
&lt;p&gt;This is confirmed when performing the actual network file transfers. In the example below, I simulate a copy of a 50 GB test file from the Gen8 towards a test system using NFS. Tests are performed using the 3-disk pool.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NFS read performance:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# dd if=/mnt/server/test2.bin of=/dev/null bs=1M
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 443.085 s, 118 MB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;NFS write performance:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# dd if=/dev/zero of=/mnt/server/test2.bin bs=1M count=50000 conv=sync 
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 453.233 s, 116 MB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I think these results are excellent. Tests with the 'cp' command give the same results.&lt;/p&gt;
&lt;p&gt;I've also done some test with the SMB/CIFS protocol. I've used a second Linux box as a CIFS client to connect to the Gen8. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CIFS read performance:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# dd if=/mnt/test/test.bin of=/dev/null bs=1M
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 527.778 s, 99.3 MB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;CIFS write performance:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# dd if=/dev/zero of=/mnt/test/test3.bin bs=1M count=50000 conv=sync
50000+0 records in
50000+0 records out
52428800000 bytes (52 GB) copied, 448.677 s, 117 MB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Hot-swap support&lt;/h3&gt;
&lt;p&gt;Although it's even printed on the hard drive caddies that hot-swap is not supported, it does seem to work perfectly fine if you run the SATA controller in AHCI mode. &lt;/p&gt;
&lt;h3&gt;Fifth SATA port for SSD SLOG/L2ARC?&lt;/h3&gt;
&lt;p&gt;If you buy a converter cable that converts a floppy power connector to a SATA power connector, you could install an SSD. This SSD can then be used as a dedicated SLOG device and/or L2ARC cache if you have a need for this.&lt;/p&gt;
&lt;h3&gt;RAIDZ, is that OK?&lt;/h3&gt;
&lt;p&gt;If you want maximum storage capacity with redundancy RAIDZ is the only option. RAID6 or two mirrored VDEVs is more reliable, but will reduce available storage space by a third. &lt;/p&gt;
&lt;p&gt;The main risk of RAIDZ is a double-drive failure. As with larger drive sizes, a resilver of a VDEV will take quite some time. It could take more than a day before the pool is resilvered, during which you run without redundancy.&lt;/p&gt;
&lt;p&gt;With the low number of drives in the VDEV the risk of a second drive failure may be low enough to be acceptable. That's up to you.&lt;/p&gt;
&lt;h3&gt;Noise levels&lt;/h3&gt;
&lt;p&gt;In the past, there have been &lt;a href="http://h30499.www3.hp.com/t5/ProLiant-Servers-Netservers/MicroServer-Gen8-is-noisy/td-p/6171563/page/3#.Vc31JLQbaS0"&gt;reports&lt;/a&gt; about the Gen8 making tons of noise because the rear chasis fan spins at a high RPM if the RAID card is set to AHCI mode.&lt;/p&gt;
&lt;p&gt;I myself have not encountered this problem. The machine is almost silent.&lt;/p&gt;
&lt;h3&gt;Power consumption&lt;/h3&gt;
&lt;p&gt;With drives spinning: 50-55 Watt.
With drives standby: 30-35 Watt.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;I think my benchmarks show that the Microserver Gen8 could be an interesting platform if you want to create your own ZFS-based NAS.&lt;/p&gt;
&lt;p&gt;Please note that it is likely that since the Gen9 server platform is already out for some time, HP may release a Gen9 version of the microserver in the near future. However as of August 2015, there is no information on this yet and it is not clear if a successor is going to be released.&lt;/p&gt;</content><category term="Storage"/><category term="ZFS"/><category term="microserver"/></entry><entry><title>The sorry state of CoW file systems</title><link href="https://louwrentius.com/the-sorry-state-of-cow-file-systems.html" rel="alternate"/><published>2015-03-01T12:00:00+01:00</published><updated>2015-03-01T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2015-03-01:/the-sorry-state-of-cow-file-systems.html</id><summary type="html">&lt;p&gt;I'd like to argue that both ZFS and BTRFS both are incomplete file systems with their own drawbacks and that it may still be a long way off before we have something truly great.&lt;/p&gt;
&lt;p&gt;Both ZFS and BTRFS are two heroic feats of engineering, created by people who are probably …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'd like to argue that both ZFS and BTRFS both are incomplete file systems with their own drawbacks and that it may still be a long way off before we have something truly great.&lt;/p&gt;
&lt;p&gt;Both ZFS and BTRFS are two heroic feats of engineering, created by people who are probably ten times more capable and smarter than me. There is no question about my appreciation for these file systems and what they accomplish. &lt;/p&gt;
&lt;p&gt;Still, as an end-user, I would like to see some features that are often either missing or not complete. Make no mistake, I believe that both ZFS and BTRFS are probably the best file systems we have today. But they can be much better.&lt;/p&gt;
&lt;p&gt;I want to start with a terse and quick overview on why both ZFS and BTRFS are such great file systems and why you should take some interest in them. &lt;/p&gt;
&lt;p&gt;Then I'd like to discuss their individual drawbacks and explain my argument.&lt;/p&gt;
&lt;h3&gt;Why ZFS and BTRFS are so great&lt;/h3&gt;
&lt;p&gt;Both ZFS and BTRFS are great for two reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;They focus on preserving data integrity&lt;/li&gt;
&lt;li&gt;They simplify storage management&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Data integrity&lt;/h3&gt;
&lt;p&gt;ZFS and BTRFS implement two important techniques that help preserve data. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Data is checksummed and its checksum is verified to guard against &lt;a href="https://indico.desy.de/contributionDisplay.py?contribId=65&amp;amp;sessionId=42&amp;amp;confId=257"&gt;bit rot&lt;/a&gt; due to broken hard drives or flaky storage controllers. If redundancy is available (RAID), errors can even be corrected. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy-on-Write (CoW), existing data is never overwritten, so any calamity like sudden power loss cannot cause existing data to be in an inconsistent state.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Simplified storage management&lt;/h3&gt;
&lt;p&gt;In the old days, we had MDADM or hardware RAID for redundancy. LVM for logical volume management and then on top of that, we have the file system of choice (EXT3/4, XFS, REISERFS, etc). &lt;/p&gt;
&lt;p&gt;The main problem with this approach is that the layers are not aware of each other and this makes things very inefficient and more difficult to administer. Each layer needs it's own attention. &lt;/p&gt;
&lt;p&gt;For example, if you simply want to expand storage capacity, you need to add drives to your RAID array and expand it. Then, you have to alert the LVM layer of the extra storage and as a last step, grow the file system. &lt;/p&gt;
&lt;p&gt;Both ZFS and BTRFS make capacity expansion a simple one line command that addresses all three steps above. &lt;/p&gt;
&lt;p&gt;Why are ZFS and BTRFS capable of doing this? Because they incorporate RAID, LVM and the file system in one single integrated solution. Each 'layer' is aware of the other, they are tightly integrated. Because of this integration, rebuilds after a drive faillure are often faster than with 'legacy RAID' solutions, because they only need to rebuild the actual data, not the entire drive. &lt;/p&gt;
&lt;p&gt;And I'm not even talking about the joy of snapshots here. &lt;/p&gt;
&lt;h3&gt;The inflexibility of ZFS&lt;/h3&gt;
&lt;p&gt;The storage building block of ZFS is a VDEV. A VDEV is either a single disk (not so interesting) or some RAID scheme, such as mirroring, single-parity (RAIDZ), dual-parity (RAIDZ2) and even tripple-parity (RAIDZ3).&lt;/p&gt;
&lt;p&gt;To me, a big downside to ZFS is the fact that you &lt;em&gt;cannot expand&lt;/em&gt; a VDEV. Ok, the only way you can expand the VDEV is quite convoluted. You have to replace all of the existing drives, one by one, with bigger ones and rebuild the VDEV each time you replace one of the drives. Then, when all drives are of the higher capacity, you can expand your VDEV. This is quite impractical and time-consuming, if you ask me.&lt;/p&gt;
&lt;p&gt;ZFS expects you just to add extra VDEVS. So if you start with a single 6-drive RAIDZ2 (RAID6), you are expected to add another 6-drive RAIDZ2 if you want to expand capacity. &lt;/p&gt;
&lt;p&gt;What I would want to do is just to ad one or two more drives and grow the VDEV, as is possible with many hardware RAID solutions and with "MDADM --grow" for ages.&lt;/p&gt;
&lt;p&gt;Why do I prefer this over adding VDEVS? Because it's quite evident that this is way more economical. If I can just expand my RAIDZ2 from 6 drives to 12 drives, I would only sacrifice two drives for parity. If I add two VDEVS each of them RAIDZ2, I sacrifice four drives (16% vs 33% capacity loss). &lt;/p&gt;
&lt;p&gt;I can imagine that in the enterprise world, this is just not that big of a deal, a bunch of drives are a rounding error on the total budget and availability and performance are more important. Still, I'd like to have this option.&lt;/p&gt;
&lt;p&gt;Either you are forced to buy and implement the storage you may expect to need in the future, or you must add it later on, wasting drives on parity you would otherwise not have done. &lt;/p&gt;
&lt;p&gt;Maybe my wish for a zpool grow option is more geared to hobbyist or home usage of ZFS and ZFS was always focussed on enterprise needs, not the needs of hobbyists. So I'm aware of the context here.&lt;/p&gt;
&lt;p&gt;I'm not done with ZFS however, because the way ZFS works, there is another great inflexibility. If you don't put the 'right' number of drives in a VDEV, you may lose significant portions of storage, which is a side-effect of how ZFS works. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;The following ZFS pool configurations are optimal for modern 4K sector harddrives:
RAID-Z: 3, 5, 9, 17, 33 drives
RAID-Z2: 4, 6, 10, 18, 34 drives
RAID-Z3: 5, 7, 11, 19, 35 drives
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I've seen first-hand with my 71 TiB NAS that if you don't use the optimal number of drives in a VDEV, you may lose whole drives worth of netto storage capacity. In that regard, my 24-drive chassis is very suboptimal. &lt;/p&gt;
&lt;h3&gt;The sad state of RAID on BTRFS&lt;/h3&gt;
&lt;p&gt;BTRFS has none of the downsides of ZFS as described in the previous section as far as I'm aware of. It has plenty of its own, though. First of all: BTRFS is still not stable, especially &lt;a href="http://kernelnewbies.org/Linux_3.19"&gt;the RAID 5/6 part is unstable&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The RAID 5 and RAID 6 implementation are so new, the ink they were written with is still wet (February 8th 2015). Not something you want to trust your important data to I suppose. &lt;/p&gt;
&lt;p&gt;I did setup a test environment to play a bit with this new Linux kernel (3.19.0) and BTRFS to see how it works and although it is not production-ready yet, I really like what I see. &lt;/p&gt;
&lt;p&gt;With BTRFS you can just add or remove drives to a RAID6 array as you see fit. Add two? Subtract 3? Whatever, the only thing you have to wait for is BTRFS rebalancing the data over either the new or remaining drives. &lt;/p&gt;
&lt;p&gt;This is friggin' awesome. &lt;/p&gt;
&lt;p&gt;If you want to remove a drive, just wait for BTRFS to copy the data from that drive to the other remaining drives and you can remove it. You want to expand storage? Just add the drives to your storage pool and have BTRFS rebalance the data (which may take a while, but it works).&lt;/p&gt;
&lt;p&gt;But I'm still a bit sad. Because BTRFS does not support anything beyond RAID6. No multiple RAID6 (RAID60) arrays or tripple-parity, as ZFS supports for ages. As with my 24-drive file server, putting 24 drives in a single RAID6, starts to feel like I'm asking for trouble. Tripple-parity or RAID 60 would probably be more reasonable. But no luck with BTRFS. &lt;/p&gt;
&lt;p&gt;However, what really frustrates me is &lt;a href="http://blog.ronnyegner-consulting.de/2014/12/10/parity-based-redundancy-raid56triple-parity-and-beyond-on-btrfs-and-mdadm-dec-2014/comment-page-1/#comment-784446"&gt;this article&lt;/a&gt; by Ronny Egner. The author of snapraid, Andrea Mazzoleni, has written a functional patch for BTRFS that implements not only tripple-parity RAID, but even up to &lt;em&gt;six&lt;/em&gt; parity disks for a volume. &lt;/p&gt;
&lt;p&gt;The maddening thing is that the BTRFS maintainers are not planning to include this patch into the BTRFS code base. Please read Ronny's blog. The people working on BTRFS are working for enterprises who want enterprise features. They don't care about tripple-parity or features like that because they have access to something presumably better: distributed file systems, which may do away with the need for larger disk arrays and thus tripple-parity. &lt;/p&gt;
&lt;p&gt;BTRFS is in development for a very long time and only recently has RAID 5/6 support been introduced. The risk of the write-hole, something addressed by ZFS ages ago, is still an open issue. Considering all of this, BTRFS is still a very long way off, of being the file system of choice for larger storage arrays.&lt;/p&gt;
&lt;p&gt;BTRFS seems to be way more flexible in terms of storage expansion or shrinking, but it slow pace of development makes it still unusable for anything serious for at least the next year I guess. &lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;BTRFS addresses all the inflexibilities of ZFS but it's immaturity and lack of more advanced RAID schemes makes it unusable for larger storage solutions. This is so sad because by design it seems to be the better, way more flexible option as compared to ZFS.&lt;/p&gt;
&lt;p&gt;I do understand the view of the BTRFS developers. With the enterprise data sets, at scale, it's better to use distributed file systems to handle storage and redundancy, than on the smaller system scale. But this kind of environment is not reachable for many. &lt;/p&gt;
&lt;p&gt;So at the moment, compared to BTRFS, ZFS is still the better option for people who want to setup large, reliable storage arrays.&lt;/p&gt;</content><category term="Storage"/><category term="ZFS"/><category term="BTRFS"/></entry><entry><title>Configuring SCST iSCSI target on Debian Linux (Wheezy)</title><link href="https://louwrentius.com/configuring-scst-iscsi-target-on-debian-linux-wheezy.html" rel="alternate"/><published>2015-02-01T12:00:00+01:00</published><updated>2015-02-01T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2015-02-01:/configuring-scst-iscsi-target-on-debian-linux-wheezy.html</id><summary type="html">&lt;p&gt;My goal is to export ZFS zvol volumes through iSCSI to other machines. The platform I'm using is Debian Wheezy. &lt;/p&gt;
&lt;p&gt;There are three iSCSI target solutions available for Linux:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://linux-iscsi.org/wiki/Main_Page"&gt;LIO&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://iscsitarget.sourceforge.net"&gt;IET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://scst.sourceforge.net"&gt;SCST&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I've briefly played with &lt;a href="http://linux-iscsi.org/wiki/Main_Page"&gt;LIO&lt;/a&gt; but the targetcli tool is interactive only. If you want to automate and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My goal is to export ZFS zvol volumes through iSCSI to other machines. The platform I'm using is Debian Wheezy. &lt;/p&gt;
&lt;p&gt;There are three iSCSI target solutions available for Linux:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://linux-iscsi.org/wiki/Main_Page"&gt;LIO&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="http://iscsitarget.sourceforge.net"&gt;IET&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://scst.sourceforge.net"&gt;SCST&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I've briefly played with &lt;a href="http://linux-iscsi.org/wiki/Main_Page"&gt;LIO&lt;/a&gt; but the targetcli tool is interactive only. If you want to automate and use scripts, you need to learn the Python API. I wonder what's wrong with a plain old text-based configuration file. &lt;/p&gt;
&lt;p&gt;iscsitarget or &lt;a href="http://iscsitarget.sourceforge.net"&gt;IET&lt;/a&gt; is broken on Debian Wheezy. If you just 'apt-get install iscsitarget', the iSCSI service will just crash as soon as you connect to it. This has been the case for years. I wonder why they don't just drop this package. It is true that you can manually download the "latest" version of IET, but don't bother, it seems abandoned. The &lt;a href="http://sourceforge.net/projects/iscsitarget/files/iscsitarget/"&gt;latest release&lt;/a&gt; stems from 2010.&lt;/p&gt;
&lt;p&gt;It seems that &lt;a href="http://scst.sourceforge.net"&gt;SCST&lt;/a&gt; is at least maintained and uses plain old text-based configuration files. So it has that going for it, which is nice. SCST does not require kernel patches to run. But particularly a patch regarding "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION" is said to improve performance. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;To use full power of TCP zero-copy transmit functions, especially
dealing with user space supplied via scst_user module memory, iSCSI-SCST
needs to be notified when Linux networking finished data transmission.
For that you should enable CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION
kernel config option. This is highly recommended, but not required.
Basically, iSCSI-SCST works fine with an unpatched Linux kernel with the
same or better speed as other open source iSCSI targets, including IET,
but if you want even better performance you have to patch and rebuild
the kernel.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So in general, patching your kernel is not always required, but an example will be given anyway.&lt;/p&gt;
&lt;h3&gt;Getting the source&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cd /usr/src
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We need the following files:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;wget http://heanet.dl.sourceforge.net/project/scst/scst/scst-3.0.0.tar.bz2
wget http://heanet.dl.sourceforge.net/project/scst/iscsi-scst/iscsi-scst-3.0.0.tar.bz2
wget http://heanet.dl.sourceforge.net/project/scst/scstadmin/scstadmin-3.0.0.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We extract them with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar xjf scst-3.0.0.tar.bz2
tar xjf iscsi-scst-3.0.0.tar.bz2
tar xjf scstadmin-3.0.0.tar.bz2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Patching the kernel&lt;/h3&gt;
&lt;p&gt;You can skip this part if you don't feel like you need or want to patch your kernel. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt-get install linux-source kernel-package
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We need to extract the kernel source:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cd /usr/src
tar xjf linux-source-3.2.tar.bz2
cd linux-source-3.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we first copy the kernel configuration from the current system:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cp /boot/config-3.2.0-4-amd64 .config
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We patch the kernel with two patches:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;patch -p1 &amp;lt; /usr/src/scst-3.0.0/kernel/scst_exec_req_fifo-3.2.patch
patch -p1 &amp;lt; /usr/src/iscsi-scst-3.0.0/kernel/patches/put_page_callback-3.2.57.patch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It seems that for many different kernel versions, separate patches can be found in the above paths. If you follow these steps at a later date, please check the version numbers.&lt;/p&gt;
&lt;p&gt;The patches are based on stock kernels from kernel.org. I've applied the patches against the Debian-patched kernel and faced no problems, but your milage may vary. &lt;/p&gt;
&lt;p&gt;Let's build the kernel (will take a while):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;yes | make-kpkg -j $(nproc) --initrd --revision=1.0.custom.scst kernel_image
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The 'yes' is piped into the make-kpkg command to answer some questions with 'yes' during compilation. You could also add the appropriate value in the .config file.&lt;/p&gt;
&lt;p&gt;The end-result of this command is a kernel package in .deb format in /usr/src.
Install it like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dpkg -i /usr/src/&amp;lt;custom kernel image&amp;gt;.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now reboot into the new kernel:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;reboot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Compiling SCST, ISCS-SCST and SCSTADMIN&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cd /usr/src/scst-3.0.0
make install

cd /usr/src/iscsi-scst-3.0.0
make install

cd /usr/src/scstadmin-3.0.0
make install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Make SCST start at boot&lt;/h3&gt;
&lt;p&gt;On Debian Jessie:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;systemctl enable scst.service
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Configure SCST&lt;/h3&gt;
&lt;p&gt;Copy the example configuration file to /etc:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cp /usr/src/iscsi-scst-3.0.0/etc/scst.conf /etc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Edit /etc/scst.conf to your liking. This is an example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;HANDLER vdisk_fileio {
        DEVICE disk01 {
                filename /dev/sdb
                nv_cache 1
        }
}

TARGET_DRIVER iscsi {
        enabled 1

        TARGET iqn.2015-10.net.vlnb:tgt {
                IncomingUser &amp;quot;someuser somepasswordof12+chars&amp;quot;
                HeaderDigest   &amp;quot;CRC32C,None&amp;quot;
                DataDigest   &amp;quot;CRC32C,None&amp;quot;
                LUN 0 disk01

                enabled 1
        }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Please note that the &lt;strong&gt;password must be at least 12 characters&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;After this, you can start the SCST module and connect your initiator to the appropriate LUN.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/etc/init.d/scst start
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3&gt;Closing words&lt;/h3&gt;
&lt;p&gt;It turned out that setting up SCST and compiling a kernel wasn't that much of a hassle. The main issue with patching kernels is that you have to repeat the procedure every time a new kernel version is released. And there is always a risk that a new kernel version breaks the SCST patches. &lt;/p&gt;
&lt;p&gt;However, the whole process can be easily automated and thus run as a test in a virtual environment. &lt;/p&gt;</content><category term="Storage"/><category term="iSCSI"/><category term="SCST"/></entry><entry><title>71 TiB DIY NAS based on ZFS on Linux</title><link href="https://louwrentius.com/71-tib-diy-nas-based-on-zfs-on-linux.html" rel="alternate"/><published>2014-08-02T21:08:00+02:00</published><updated>2014-08-02T21:08:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-08-02:/71-tib-diy-nas-based-on-zfs-on-linux.html</id><summary type="html">&lt;p&gt;This is my new 71 TiB DIY NAS. This server is the successor to my six year old, twenty drive &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS (17 TiB)&lt;/a&gt;. With a storage capacity four times higher than the original and an incredible read (2.5 GB/s)/write (1.9 GB/s) performance, it's …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is my new 71 TiB DIY NAS. This server is the successor to my six year old, twenty drive &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS (17 TiB)&lt;/a&gt;. With a storage capacity four times higher than the original and an incredible read (2.5 GB/s)/write (1.9 GB/s) performance, it's a worthy successor. &lt;/p&gt;
&lt;p&gt;&lt;img alt="zfs nas" src="https://louwrentius.com/static/images/zfsnas01.jpg" /&gt;&lt;/p&gt;
&lt;h3&gt;Purpose&lt;/h3&gt;
&lt;p&gt;The purpose of this machine is to store backups and media, primarily video.&lt;/p&gt;
&lt;h3&gt;The specs&lt;/h3&gt;
&lt;table border="0" cellpadding="5" cellspacing="1" &gt;
&lt;tr&gt;&lt;th&gt;Part&lt;/th&gt;&lt;th&gt;Description &lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Case&lt;/td&gt;&lt;td &gt;Ri-vier RV-4324-01A&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Processor&lt;/td&gt;&lt;td &gt;Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;RAM&lt;/td&gt;&lt;td &gt;16 GB ECC&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Motherboard&lt;/td&gt;&lt;td &gt;Supermicro X9SCM-F&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;LAN&lt;/td&gt;&lt;td &gt;Intel Gigabit &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Storage Connectivity&lt;/td&gt;&lt;td &gt;&lt;strike&gt;InfiniBand MHGA28-XTC&lt;/strike&gt; 2023: Mellanox ConnectX-3 Pro 10Gbit Ethernet (X312B-XCCT)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;PSU&lt;/td&gt;&lt;td &gt;Seasonic Platinum 860&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Controller&lt;/td&gt;&lt;td &gt; 3 x IBM M1015&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Disk&lt;/td&gt;&lt;td &gt;24 x HGST HDS724040ALE640 4 TB (7200RPM) &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;SSD&lt;/td&gt;&lt;td &gt;2 x Crucial M500 120GB in RAID 1 for boot drives&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Arrays&lt;/td&gt;&lt;td &gt;Boot: 2 x 120 GB RAID 1 and storage: 18 disk RAIDZ2+ 6 disk RAIDZ2 &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Brutto storage&lt;/td&gt;&lt;td &gt; 86 TiB (96 TB)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Netto storage&lt;/td&gt;&lt;td &gt;71 TiB (78 TB)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS&lt;/td&gt;&lt;td &gt;&lt;strike&gt;Linux Debian Wheezy&lt;/strike&gt;2023: Ubuntu 22.04&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Filesystem&lt;/td&gt;&lt;td &gt;ZFS&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Rebuild time&lt;/td&gt;&lt;td &gt;Depends on amount of data (rate is 4 TB/Hour)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;UPS&lt;/td&gt;&lt;td&gt;&lt;strike&gt;Back-UPS RS 1200 LCD using Apcupsd&lt;/strike&gt; None&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Power usage&lt;/td&gt;&lt;td &gt;about &amp;nbsp;200 Watt idle &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;&lt;img alt="front" src="https://louwrentius.com/static/images/nano/topview.jpg" /&gt;
&lt;img alt="front" src="https://louwrentius.com/static/images/nano/4cards.jpg" /&gt;
&lt;img alt="front" src="https://louwrentius.com/static/images/nano/backside.jpg" /&gt;&lt;/p&gt;
&lt;iframe width="560" height="315" src="//www.youtube.com/embed/LS3cfl-7n-4" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;

&lt;h3&gt;CPU&lt;/h3&gt;
&lt;p&gt;The Intel Xeon E3-1230 V2 is not the latest generation but one of the cheapest Xeons you can buy and it supports ECC memory. It's a quad-core processor with hyper-threading. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+E3-1230+V2+%40+3.30GHz"&gt;Here&lt;/a&gt; you can see how it performs compared to other processors.&lt;/p&gt;
&lt;h3&gt;Memory&lt;/h3&gt;
&lt;p&gt;The system has 16 GB ECC RAM. Memory is relatively cheap these days but I don't have any reason to upgrade to 32 GB. I think that 8 GB would have been fine with this system.&lt;/p&gt;
&lt;h3&gt;Motherboard&lt;/h3&gt;
&lt;p&gt;The server is build around the &lt;a href="https://louwrentius.com/an-affordable-server-platform-based-on-server-grade-hardware.html"&gt;SuperMicro X95SCM-F motherboard&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a server-grade motherboard and comes with typical features you might expect, like ECC memory support and out-of-band management (IPMI). &lt;/p&gt;
&lt;p&gt;&lt;img alt="smboard top view" src="https://www.supermicro.nl/a_images/products/Xeon/C204/X9SCM-F_spec.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This motherboard has four PCIe slots (2 x 8x and 2 x 4x) in an 8x physical slot. My build requires four PCIe 4x+ slots and there aren't (m)any other server boards at this price point that support four PCIe slots in a 8x sized slot.&lt;/p&gt;
&lt;h3&gt;The chassis&lt;/h3&gt;
&lt;p&gt;The chassis has six rows of four drive bays that are kept cool by three 120mm fans in a fan wall behind the drive bays. At the rear of the case, there are two 'powerful' 80mm fans that remove the heat from the case, together with the PSU.&lt;/p&gt;
&lt;p&gt;The chassis has six SAS backplanes that connect four drives each. The backplanes have dual molex power connectors, so you can put redundant power supplies into the chassis. Redundant power supplies are more expensive and due to their size, often have smaller, thus noisier fans. As this is a home build, I opted for just a single regular PSU.&lt;/p&gt;
&lt;p&gt;When facing the front, there is a place at the left side of the chassis to mount a single 3.5 inch or two 2.5 inch drives next to each other as boot drives. I've
mounted two SSDs (RAID1).&lt;/p&gt;
&lt;p&gt;This particular chassis version has support for SPGIO, which should help identifying which drive has failed. The IBM 1015 cards I use do support SGPIO.
Through the LSI megaraid CLI I have verified that SGPIO works, as you can use this tool as a drive locator. I'm not entirely sure how well SGPIO works with ZFS. &lt;/p&gt;
&lt;h3&gt;Power supply&lt;/h3&gt;
&lt;p&gt;I was using a Corsair 860i before, but it was unstable and died on me.&lt;/p&gt;
&lt;p&gt;The Seasonic Platinum 860 may seem like overkill for this system. However, I'm not using staggered spinup for the 24 drives. So the drives all spinup at once and this results in a peak power usage of 600+ watts. &lt;/p&gt;
&lt;p&gt;The PSU has a silent mode that causes the fan only to spin if the load reaches a certain threshold. Since the PSU fan also helps removing warm air from the chassis, I've disabled this feature, so the fan is spinning at all times.&lt;/p&gt;
&lt;h3&gt;Drive management&lt;/h3&gt;
&lt;p&gt;I've written a tool called &lt;a href="https://github.com/louwrentius/lsidrivemap"&gt;lsidrivemap&lt;/a&gt; that displays each drive
in an ASCII table that reflects the physical layout of the chassis.&lt;/p&gt;
&lt;p&gt;The data is based on the output of the LSI 'megacli' tool for my IBM 1015 controllers.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# lsidrivemap disk

| sdr | sds | sdt | sdq |
| sdu | sdv | sdx | sdw |
| sdi | sdl | sdp | sdm |
| sdj | sdk | sdn | sdo |
| sdb | sdc | sde | sdf |
| sda | sdd | sdh | sdg |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This layout is 'hardcoded' for my chassis but the Python script can be easily
tailored for your own server, if you're interested.&lt;/p&gt;
&lt;p&gt;It can also show the temperature of the disk drives in the same table:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:~# lsidrivemap temp

| 36 | 39 | 40 | 38 |
| 36 | 36 | 37 | 36 |
| 35 | 38 | 36 | 36 |
| 35 | 37 | 36 | 35 |
| 35 | 36 | 36 | 35 |
| 34 | 35 | 36 | 35 |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;These temperatures show that the top drives run a bit hotter than the other drives. An unverified explanation could be that the three 120mm fans are not in the center of the fan wall. They are skewed to the bottom of the wall, so they may favor the lower drive bays.&lt;/p&gt;
&lt;h3&gt;Filesystem (ZFS)&lt;/h3&gt;
&lt;p&gt;I'm using ZFS as the file system for the storage array. At this moment, there is no other file system that has the same features and stability as ZFS. BTRFS is not even finished.&lt;/p&gt;
&lt;p&gt;The number one design goal of ZFS was assuring data integrity. ZFS checksums all data and if you use RAIDZ or a mirror, it can even repair data. Even if it can't repair a file, it can at least tell you which files are corrupt.&lt;/p&gt;
&lt;p&gt;ZFS is not primarily focussed on performance, but to get the best performance possible, it makes heavy usage of RAM to cache both reads and writes. This is why ECC memory is so important. &lt;/p&gt;
&lt;p&gt;ZFS also implements RAID. So there is no need to use MDADM. My previous file server was running a single RAID 6 of 20 x 1TB drives. With this new system I've created a single pool with two RAIDZ2 VDEVs. &lt;/p&gt;
&lt;h3&gt;Capacity&lt;/h3&gt;
&lt;p&gt;Vendors still advertise the capacity of their hard drives in TB whereas the operating system works with TiB. So the 4 TB drives I use are in fact 3.64 TiB.&lt;/p&gt;
&lt;p&gt;The total raw storage capacity of the system is about 86 TiB.&lt;/p&gt;
&lt;p&gt;My zpool is the 'appropriate' number of disks (2^n + parity^)  in the VDEVs. So I have one 18 disk RAIDZ2 VDEV (2^4+2) and one 6 disk RAIDZ2 VDEV (2^2+2^) for a total of 24 drives.&lt;/p&gt;
&lt;p&gt;Different VDEV sizes in a single pool are often not recommended, but ZFS is very smart and cool: it load-balances the data across the VDEVs based on the size of the VDEV. I could verify this with zpool iostat -v 5 and witness this in real-time. The small VDEV got just a fraction of the data compared to the large VDEV.&lt;/p&gt;
&lt;p&gt;This choice leaves me with less capacity (71 TiB vs. 74 TiB for RAIDZ3) and also has a bit more risk to it, with the eighteen-disk RAIDZ2 VDEV. Regarding this latter risk, I've been running a twenty-disk MDADM RAID6 for the last 6 years and haven't seen any issues. That does not tell everything, but I'm comfortable with this risk.&lt;/p&gt;
&lt;p&gt;Originalyl I was planning on using RAIDZ3 and by using ashift=9 (512 byte sectors) I would recuperate most of the space lost to the non-optimal number of drives in the VDEV. So why did I change my mind? Because the performance of my ashift=9 pool on my 4K drives deteriorated so much that a resilver of a failed drive would take ages.&lt;/p&gt;
&lt;hr /&gt;
&lt;h3&gt;Storage controllers&lt;/h3&gt;
&lt;p&gt;The IBM 1015 HBA's are reasonably priced and buying three of them, is often cheaper than buying just one HBA with a SAS expander. However, it may be cheaper to search for an HP SAS expander and use it with just one M1015 and save a PCIe slot.&lt;/p&gt;
&lt;p&gt;I have not flashed the controllers to 'IT mode', as most people do. They worked out-of-the-box as HBAs and although it may take a little bit longer to
boot the system, I decided not to go through the hassle.&lt;/p&gt;
&lt;p&gt;The main risk here is how the controller handles a drive if a sector is not properly read. It may disable the drive entirely, which is not necessary for ZFS and often not preferred.&lt;/p&gt;
&lt;h3&gt;Storage performance&lt;/h3&gt;
&lt;p&gt;With twenty-four drives in a chassis, it's interesting to see what kind of performance you can get from the system. &lt;/p&gt;
&lt;p&gt;Let's start with a twenty-four drive RAID 0. The drives I use have a sustained read/write speed of 160 MB/s so it should be possible to reach 3840 MB/s or 3.8 GB/s. That would be amazing. &lt;/p&gt;
&lt;p&gt;This is the performance of a RAID 0 (MDADM) of all twenty-four drives. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=test.bin bs=1M count=1000000
1048576000000 bytes (1.0 TB) copied, 397.325 s, 2.6 GB/s

root@nano:/storage# dd if=test.bin of=/dev/null bs=1M
1048576000000 bytes (1.0 TB) copied, 276.869 s, 3.8 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Dead on, you would say, but if you divide 1 TB with 276 seconds, it's more like 3.6 GB/s. I would say that's still quite close.&lt;/p&gt;
&lt;p&gt;This machine will be used as a file server and a bit of redundancy would be nice. So what happens if we run the same benchmark on a RAID6 of all drives?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=test.bin bs=1M count=100000
104857600000 bytes (105 GB) copied, 66.3935 s, 1.6 GB/s

root@nano:/storage# dd if=test.bin of=/dev/null bs=1M
104857600000 bytes (105 GB) copied, 38.256 s, 2.7 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I'm quite pleased with these results, especially for a RAID6. However, RAID6 with twenty-four drives feels a bit risky. So since there is no support for a three-parity disk RAID in MDADM/Linux, I use ZFS.&lt;/p&gt;
&lt;p&gt;Sacrificing performance, I decided - as I mentioned earlier - to use ashift=9 on those 4K sector drives, because I gained about 5 TiB of storage in exchange. &lt;/p&gt;
&lt;p&gt;This is the performance of twenty-four drives in a RAIDZ3 VDEV with ashift=9.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=ashift9.bin bs=1M count=100000 
104857600000 bytes (105 GB) copied, 97.4231 s, 1.1 GB/s

root@nano:/storage# dd if=ashift9.bin of=/dev/null bs=1M
104857600000 bytes (105 GB) copied, 42.3805 s, 2.5 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Compared to the other results, write performance is way down, although not too bad.&lt;/p&gt;
&lt;p&gt;This is the write performance of the 18 disk RAIDZ2 + 6 disk RAIDZ2 zpool (ashift=12):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=test.bin bs=1M count=1000000 
1048576000000 bytes (1.0 TB) copied, 543.072 s, 1.9 GB/s

root@nano:/storage# dd if=test.bin of=/dev/null bs=1M 
1048576000000 bytes (1.0 TB) copied, 400.539 s, 2.6 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;As you may notice, the write performance is better than the ashift=9 or ashift=12 RAIDZ3 VDEV. &lt;/p&gt;
&lt;p&gt;In the end I chose to use the 18 disk RAIDZ2 + 6  disk RAIDZ2 setup because of the better performance and to adhere to the standards of ZFS.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;I have not benchmarked random I/O performance as it is not relevant for this system. And with ZFS, the random I/O performance of a VDEV is that of a single drive.&lt;/p&gt;
&lt;h3&gt;Boot drives&lt;/h3&gt;
&lt;p&gt;I'm using two Crucial M500 120GB SSD drives. They are configured in a RAID1 (MDADM) and I've installed Debian Wheezy on top of them. &lt;/p&gt;
&lt;p&gt;At first, I was planning on using a part of the capacity for caching purposes in combination with ZFS. However, there's no real need to do so. In hindsight I could also have used to very cheap 2.5" hard drives (simmilar to my older NAS), which would have cost less than a single M500.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2014-09-01:&lt;/strong&gt; I actually reinstalled Debian and kept about 50% free space on both M500s and put this space in a partition. These partitions have been provided to the ZFS pool as L2ARC cache. I did this because I could, but on the other hand, I wonder if I'm only really just wearing out my SSDs faster.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2015-10-04:&lt;/strong&gt; I saw no reason why I would wear out my SSDs as a L2ARC so I removed them from my pool. There is absolutely no benefit in my case.&lt;/p&gt;
&lt;h3&gt;Networking (updated 2017-03-25)&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Current:&lt;/strong&gt;
I have installed a Mellanox MHGA28-XTC InfiniBand card. I'm using InfiniBand over IP so the InfiniBand card is effectively a faster network card. I have a point-to-point connection with another server, I do not have an InfiniBand switch. &lt;/p&gt;
&lt;p&gt;I get about 6.5 Gbit from this card, which is not even near the theoretical performance limit. However, this translate into a constant 750 MB/s file transfer speed over NFS, which is amazing.&lt;/p&gt;
&lt;p&gt;Using Linux bonding and the quad-port Ethernet adapter, I only got 400 MB/s and transfer speeds were fluctuating a lot. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Original:&lt;/strong&gt;
Maybe I will invest in 10Gbit ethernet or InfiniBand hardware in the future, but for now I settled on a quad-port gigabit adapter. With Linux bonding, I can still get &lt;a href="https://louwrentius.com/achieving-450-mbs-network-file-transfers-using-linux-bonding.html"&gt;450+ MB/s&lt;/a&gt; data transfers, which is sufficient for my needs.&lt;/p&gt;
&lt;p&gt;The quad-port card is in addition to the two on-board gigabit network cards. I use one of the on-board ports for client access. The four ports on the quad-port card are all in different VLANs and not accessible for client devices.&lt;/p&gt;
&lt;p&gt;The storage will be accessible over NFS and SMB. Clients will access storage over one of the on-board Gigabit LAN interfaces.&lt;/p&gt;
&lt;h3&gt;Keeping things cool and quiet&lt;/h3&gt;
&lt;p&gt;It's important to keep the drive temperature at acceptable levels and with 24  drives packet together, there is an increased risk of overheating. &lt;/p&gt;
&lt;p&gt;The chassis is well-equipped to keep the drives cool with three 120mm fans and two strong 80mm fans, all supporting PWM (pulse-width modulation).&lt;/p&gt;
&lt;p&gt;The problem is that by default, the BIOS runs the fans at a too low speed to keep the drives at a reasonable temperature. I'd like to keep the hottest drive at about forty degrees Celsius. But I also want to keep the noise at reasonable levels. &lt;/p&gt;
&lt;p&gt;I wrote a python script called &lt;a href="https://github.com/louwrentius/storagefancontrol"&gt;storagefancontrol&lt;/a&gt; that automatically adjusts the fan speed based on the temperature of the hottest drive. &lt;/p&gt;
&lt;h3&gt;UPS&lt;/h3&gt;
&lt;p&gt;I'm running a &lt;a href="https://louwrentius.com/hp-proliant-microserver-n40l-is-a-great-nas-or-router.html"&gt;HP N40L micro server&lt;/a&gt; as my firewall/router. My APC Back-UPS RS 1200 LCD (720 Watt) is connected with USB to this machine. I'm using apcupsd to monitor the UPS and shutdown servers if the battery runs low. &lt;/p&gt;
&lt;p&gt;All servers, including my new build, run apcupsd in network mode and talk to the N40L to learn if power is still OK.&lt;/p&gt;
&lt;h3&gt;Keeping power consumption reasonable&lt;/h3&gt;
&lt;p&gt;So these are the power usage numbers.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt; 96 Watt with disks in spin down.
176 Watt with disks spinning but idle.
253 Watt with disks writing.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Edit 2015-10-04:&lt;/strong&gt;
I do have an unresolved issue where the drives keep spinning up even with all services on the box killed, including Cron. So it's configured so that the drives are always spinning. &lt;strong&gt;/end edit&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But the most important stat is that it's using 0 Watt if powered off. The system will be turned on only when necessary through wake-on-lan. It will be powered off most of the time, like when I'm at work or sleeping.&lt;/p&gt;
&lt;h3&gt;Cost&lt;/h3&gt;
&lt;p&gt;The system has cost me about €6000. All costs below are in Euro and include taxes (21%).&lt;/p&gt;
&lt;table border=0 cellpadding=0 cellspacing=0 width=447 style='border-collapse:
 collapse;table-layout:fixed;width:447pt'&gt;
 &lt;col width=89 style='mso-width-source:userset;mso-width-alt:3797;width:89pt'&gt;
 &lt;col width=234 style='mso-width-source:userset;mso-width-alt:9984;width:234pt'&gt;
 &lt;col width=33 style='mso-width-source:userset;mso-width-alt:1408;width:33pt'&gt;
 &lt;col width=50 style='mso-width-source:userset;mso-width-alt:2133;width:50pt'&gt;
 &lt;col width=41 style='mso-width-source:userset;mso-width-alt:1749;width:41pt'&gt;
 &lt;tr class=xl65 height=35 style='mso-height-source:userset;height:35.0pt'&gt;
  &lt;td height=35 class=xl67 width=89 style='height:35.0pt;width:89pt'&gt;Description&lt;/td&gt;
  &lt;td class=xl67 width=234 style='width:234pt'&gt;Product&lt;/td&gt;
  &lt;td class=xl68 width=33 style='width:33pt'&gt;Price&lt;/td&gt;
  &lt;td class=xl68 width=50 style='width:50pt'&gt;Amount&lt;/td&gt;
  &lt;td class=xl68 width=41 style='width:41pt'&gt;Total&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Chassis&lt;/td&gt;
  &lt;td&gt;Ri-vier 4U 24bay storage chassis RV-4324-01A&lt;/td&gt;
  &lt;td align=right&gt;554&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;554&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;CPU&lt;/td&gt;
  &lt;td&gt;Intel Xeon E3-1230V2&lt;/td&gt;
  &lt;td align=right&gt;197&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;197&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Mobo&lt;/td&gt;
  &lt;td&gt;SuperMicro X9SCM-F&lt;/td&gt;
  &lt;td align=right&gt;157&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;157&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;RAM&lt;/td&gt;
  &lt;td&gt;Kingston DDR3 ECC KVR1333D3E9SK2/16G&lt;span
  style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
  &lt;td align=right&gt;152&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;152&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;PSU&lt;/td&gt;
  &lt;td&gt;AX860i 80Plus Platinum&lt;/td&gt;
  &lt;td align=right&gt;175&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;175&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Network Card&lt;/td&gt;
  &lt;td&gt;NC364T PCI Express Quad Port Gigabit&lt;/td&gt;
  &lt;td align=right&gt;145&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;145&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;HBA Controller&lt;/td&gt;
  &lt;td&gt;IBM SERVERAID M1015&lt;span style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
  &lt;td align=right&gt;118&lt;/td&gt;
  &lt;td align=right&gt;3&lt;/td&gt;
  &lt;td align=right&gt;354&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;SSDs&lt;/td&gt;
  &lt;td&gt;Crucial M500 120GB&lt;/td&gt;
  &lt;td align=right&gt;62&lt;/td&gt;
  &lt;td align=right&gt;2&lt;/td&gt;
  &lt;td align=right&gt;124&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Fan&lt;span
  style="mso-spacerun:yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
  &lt;td&gt;Zalman FB123 Casefan Bracket + 92mm Fan&lt;/td&gt;
  &lt;td align=right&gt;7&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;7&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Hard Drive&lt;/td&gt;
  &lt;td&gt;Hitachi 3.5 4TB 7200RPM (0S03356)&lt;/td&gt;
  &lt;td align=right&gt;166&lt;/td&gt;
  &lt;td align=right&gt;24&lt;/td&gt;
  &lt;td align=right&gt;3984&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;SAS Cables&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td align=right&gt;25&lt;/td&gt;
  &lt;td align=right&gt;6&lt;/td&gt;
  &lt;td align=right&gt;150&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Fan cables&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td align=right&gt;6&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;6&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Sata-to-Molex&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td align=right&gt;3,5&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;3,5&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 style='height:15.0pt'&gt;Molex splitter&lt;/td&gt;
  &lt;td&gt;&lt;/td&gt;
  &lt;td align=right&gt;3&lt;/td&gt;
  &lt;td align=right&gt;1&lt;/td&gt;
  &lt;td align=right&gt;3&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr height=15 style='height:15.0pt'&gt;
  &lt;td height=15 colspan=4 style='height:15.0pt;mso-ignore:colspan'&gt;&lt;/td&gt;
  &lt;td class=xl66 align=right&gt;6012&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/table&gt;

&lt;h3&gt;Closing words&lt;/h3&gt;
&lt;p&gt;If you have any questions or remarks about what could have been done differently feel free to leave a comment, I appreciate it.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>ZFS: Performance and capacity impact of ashift=9 on 4K sector drives</title><link href="https://louwrentius.com/zfs-performance-and-capacity-impact-of-ashift9-on-4k-sector-drives.html" rel="alternate"/><published>2014-07-31T00:00:00+02:00</published><updated>2014-07-31T00:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-07-31:/zfs-performance-and-capacity-impact-of-ashift9-on-4k-sector-drives.html</id><summary type="html">&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Update 2014-8-23&lt;/strong&gt;: I was testing with ashift for my new NAS. The ashift=9 write performance deteriorated from 1.1 GB/s to 830 MB/s with just 16 TB of data on the pool. Also I noticed that resilvering was very slow. This is why I decided to abandon …&lt;/p&gt;</summary><content type="html">&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;Update 2014-8-23&lt;/strong&gt;: I was testing with ashift for my new NAS. The ashift=9 write performance deteriorated from 1.1 GB/s to 830 MB/s with just 16 TB of data on the pool. Also I noticed that resilvering was very slow. This is why I decided to abandon my 24 drive RAIDZ3 configuration.&lt;/p&gt;
&lt;p&gt;I'm aware that drives are faster at the outside of the platter and slower on the inside, but the performance deteriorated so dramatically that I did not wanted to continue further.&lt;/p&gt;
&lt;p&gt;My final setup will be a RAIDZ2 18 drive VDEV + RAIDZ2 6 drive VDEV which will give me 'only' 71 TiB of storage, but read performance is 2.6 GB/s and write performance is excellent at 1.9 GB/s. I've written about 40+ TiB to the array and after those 40 TiB, write performance was about 1.7 GB/s, so still very good and what I would expect as drives fill up.&lt;/p&gt;
&lt;p&gt;So actually, based on these results, I have learned not to deviate from the ZFS best practices too much. Use ashift=12 and put drives in VDEVS that adhere to the 2^n+parity rule. &lt;/p&gt;
&lt;p&gt;The uneven VDEVs (18 disk vs. 6 disks) are not according to best practice but ZFS is smart: it distributes data across the VDEVs based on their size. So they fill up equally. &lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Choosing between ashift=9 and ashift=12 for 4K sector drives is not always a clear cut case. You have to choose between raw performance or storage capacity.&lt;/p&gt;
&lt;p&gt;My testplatform is Debian Wheezy with ZFS on Linux. I'm using a system with 24 x 4 TB drives in a RAIDZ3. The drives have a native sector size of 4K, and the array is formatted with ashift=12.&lt;/p&gt;
&lt;p&gt;First we create the array like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool create storage -o ashift=12 raidz3 /dev/sd[abcdefghijklmnopqrstuvwx]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note: NEVER use /dev/sd? drive names for an array, this is just for testing, always use /dev/disk/by-id/ names. &lt;/p&gt;
&lt;p&gt;Then we run a simple sequential transfer benchmark with dd:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=ashift12.bin bs=1M count=100000 
100000+0 records in
100000+0 records out
104857600000 bytes (105 GB) copied, 66.4922 s, 1.6 GB/s
root@nano:/storage# dd if=ashift12.bin of=/dev/null bs=1M
100000+0 records in
100000+0 records out
104857600000 bytes (105 GB) copied, 42.0371 s, 2.5 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is quite impressive. With these speeds, you can saturate 10Gbe ethernet.
But how much storage space do we get?&lt;/p&gt;
&lt;p&gt;df -h:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Filesystem                            Size  Used Avail Use% Mounted on
storage                                69T  512K   69T   1% /storage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;zfs list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;NAME      USED  AVAIL  REFER  MOUNTPOINT
storage  1.66M  68.4T   435K  /storage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Only 68.4 TiB of storage? That's not good. There should be 24 drives minus 3 for parity is 21 x 3.6 TiB = 75 TiB of storage. &lt;/p&gt;
&lt;p&gt;So the performance is great, but somehow, we lost about 6 TiB of storage, more than a whole drive.&lt;/p&gt;
&lt;p&gt;So what happens if you create the same array with ashift=9?&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;zpool create storage -o ashift=9 raidz3 /dev/sd[abcdefghijklmnopqrstuvwx]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;These are the benchmarks:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=/dev/zero of=ashift9.bin bs=1M count=100000 
100000+0 records in
100000+0 records out
104857600000 bytes (105 GB) copied, 97.4231 s, 1.1 GB/s
root@nano:/storage# dd if=ashift9.bin of=/dev/null bs=1M
100000+0 records in
100000+0 records out
104857600000 bytes (105 GB) copied, 42.3805 s, 2.5 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So we lose about a third of our write performance, but the read performance is not affected, probably by read-ahead caching but I'm not sure. &lt;/p&gt;
&lt;p&gt;With ashift=9, we do lose some write performance, but we can still saturate 10Gbe.&lt;/p&gt;
&lt;p&gt;Now look what happens to the available storage capacity:&lt;/p&gt;
&lt;p&gt;df -h:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Filesystem                         Size  Used Avail Use% Mounted on
storage                             74T   98G   74T   1% /storage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;zfs list:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;NAME      USED  AVAIL  REFER  MOUNTPOINT
storage   271K  73.9T  89.8K  /storage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we have a capacity of 74 TiB, so we just gained 5 TiB with ashift=9 over ashift=12, at the cost of some write performance. &lt;/p&gt;
&lt;p&gt;So if you really care about sequential write performance, ashift=12 is the better option. If storage capacity is more important, ashift=9 seems to be the best solution for 4K drives.&lt;/p&gt;
&lt;p&gt;The performance of ashift=9 on 4K drives is always described as 'horrible' but I think it's best to run your own benchmarks and decide for yourself.&lt;/p&gt;
&lt;p&gt;Caveat: I'm quite sure about the benchmark performance. I'm not 100% sure how reliable the reported free space is according to df -h or zfs list.&lt;/p&gt;
&lt;p&gt;Edit: I have added a bit of my own opinion on the results.&lt;/p&gt;</content><category term="Storage"/><category term="ZFS"/><category term="Linux"/></entry><entry><title>Achieving 2.3 GB/s with 16 x 4 TB drives</title><link href="https://louwrentius.com/achieving-23-gbs-with-16-x-4-tb-drives.html" rel="alternate"/><published>2014-07-12T12:00:00+02:00</published><updated>2014-07-12T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-07-12:/achieving-23-gbs-with-16-x-4-tb-drives.html</id><summary type="html">&lt;p&gt;I'm in the process of building a new storage server to replace my &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The server is almost finished, it's now down to adding disk drives. I'm using the &lt;a href="http://www.hgst.com/tech/techlib.nsf/techdocs/A9AF74F697524DFD882577F9000CF8BD/$file/Desktop_IDK_ds.pdf"&gt;HGST 4 TB 7200 RPM&lt;/a&gt; drive for this build (SKU 0S03356) &lt;a href="http://www.storagereview.com/hitachi_deskstar_7k4000_review"&gt;(review)&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I have not bought all drives at …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'm in the process of building a new storage server to replace my &lt;a href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html"&gt;18 TB NAS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The server is almost finished, it's now down to adding disk drives. I'm using the &lt;a href="http://www.hgst.com/tech/techlib.nsf/techdocs/A9AF74F697524DFD882577F9000CF8BD/$file/Desktop_IDK_ds.pdf"&gt;HGST 4 TB 7200 RPM&lt;/a&gt; drive for this build (SKU 0S03356) &lt;a href="http://www.storagereview.com/hitachi_deskstar_7k4000_review"&gt;(review)&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I have not bought all drives at once, but slowly adding them in smaller quantities. I just don't want to feel too much pain in my wallet at once I guess. &lt;/p&gt;
&lt;p&gt;According to my own tests, this drive has a read/write throughput of 160 MB/s, which is in tune with it's specification.&lt;/p&gt;
&lt;p&gt;So the theoretical performance of a RAID 0 with 16 drives x 160 MB/s = 2560 MB/s. That's over 2.5 gigabytes per second. &lt;/p&gt;
&lt;p&gt;This is the actual real-life performance I was able to achieve. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;root@nano:/storage# dd if=pureawesomeness.dd of=/dev/null bs=1M
1000000+0 records in
1000000+0 records out
1048576000000 bytes (1.0 TB) copied, 453.155 s, 2.3 GB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Personally, 2.3 GB/s is not too shabby in my opinion. Please note that I used a test file of one terabyte, so the 16 GB of RAM my server has, doesn't skew the
result.&lt;/p&gt;
&lt;p&gt;This result is very nice, but in practice almost useless. I can saturate dual 10 Gbit NICs with this system, but I don't have that kind of equipment or any other device that could handle such performance.&lt;/p&gt;
&lt;p&gt;But I think it's amazing anyway.&lt;/p&gt;
&lt;p&gt;I'm quite curious how the final 24 drive array will perform in a RAID 0.&lt;/p&gt;</content><category term="Storage"/><category term="Storage"/></entry><entry><title>How to resolve extreme memory usage on Windows 2008 R2-based file servers</title><link href="https://louwrentius.com/how-to-resolve-extreme-memory-usage-on-windows-2008-r2-based-file-servers.html" rel="alternate"/><published>2014-06-15T12:00:00+02:00</published><updated>2014-06-15T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-06-15:/how-to-resolve-extreme-memory-usage-on-windows-2008-r2-based-file-servers.html</id><summary type="html">&lt;p&gt;I'm responsible for a file server with about 5 terrabytes of data. The file server is based on Windows 2008 R2. I've noticed extreme memory usage on the server. After a reboot, it slowly builds up until almost all RAM memory is consumed.&lt;/p&gt;
&lt;p&gt;So I googled around and found &lt;a href="http://wasthatsohard.wordpress.com/2011/03/01/high-memory-usage-windows-server-2008-r2-file-server/"&gt;this …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'm responsible for a file server with about 5 terrabytes of data. The file server is based on Windows 2008 R2. I've noticed extreme memory usage on the server. After a reboot, it slowly builds up until almost all RAM memory is consumed.&lt;/p&gt;
&lt;p&gt;So I googled around and found &lt;a href="http://wasthatsohard.wordpress.com/2011/03/01/high-memory-usage-windows-server-2008-r2-file-server/"&gt;this post&lt;/a&gt; and it turned out I had the same exact issue.&lt;/p&gt;
&lt;p&gt;I've confirmed with the tool 'RAMmap' that NTFS metadata is the issue. Microsoft also created a &lt;a href="http://blogs.technet.com/b/mspfe/archive/2012/12/06/lots-of-ram-but-no-available-memory.aspx"&gt;blog post&lt;/a&gt; about this.&lt;/p&gt;
&lt;p&gt;The author of the first article resolved the issue by adding more RAM memory. But with 16 GB already assigned, I was not to happy to add more memory to the virtual file server, eating away on the RAM resources of our virtualisation platform.&lt;/p&gt;
&lt;p&gt;I could never find a root cause of the issue. In that case, you need to obtain the 'Microsoft Windows Dynamic Cache Service'. This application allows you to configure how large the medata caching may grow. &lt;/p&gt;
&lt;p&gt;Please note that this services is not a next-next-finish installation. Follow the included Word document with instructions carefully and configure a sane memory setting for your server. I limited the cache to half the RAM available to the server and this works out well. &lt;/p&gt;</content><category term="Storage"/><category term="Windows"/><category term="file server"/></entry><entry><title>My experiences with DFS replication on Windows 2008 R2</title><link href="https://louwrentius.com/my-experiences-with-dfs-replication-on-windows-2008-r2.html" rel="alternate"/><published>2014-06-15T12:00:00+02:00</published><updated>2014-06-15T12:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-06-15:/my-experiences-with-dfs-replication-on-windows-2008-r2.html</id><summary type="html">&lt;p&gt;If you are considering implementing DFS replication, &lt;a href="http://blogs.technet.com/b/storageserver/archive/2013/10/08/windows-storage-server-2012-r2-improved-dfs-replication.aspx"&gt;consider using Windows 2012 R2&lt;/a&gt; because DFS replication has been massively improved. It supports larger data sets and performance has dramatically been improved over Windows 2008 R2. &lt;/p&gt;
&lt;p&gt;I've implemented DFS replication to keep two file servers synchronised. Click &lt;a href="http://blogs.technet.com/b/josebda/archive/2009/03/10/the-basics-of-the-windows-server-2008-distributed-file-system-dfs.aspx"&gt;here&lt;/a&gt; if or &lt;a href="http://technet.microsoft.com/en-us/library/cc732863(v=ws.10).aspx"&gt;there&lt;/a&gt; you …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you are considering implementing DFS replication, &lt;a href="http://blogs.technet.com/b/storageserver/archive/2013/10/08/windows-storage-server-2012-r2-improved-dfs-replication.aspx"&gt;consider using Windows 2012 R2&lt;/a&gt; because DFS replication has been massively improved. It supports larger data sets and performance has dramatically been improved over Windows 2008 R2. &lt;/p&gt;
&lt;p&gt;I've implemented DFS replication to keep two file servers synchronised. Click &lt;a href="http://blogs.technet.com/b/josebda/archive/2009/03/10/the-basics-of-the-windows-server-2008-distributed-file-system-dfs.aspx"&gt;here&lt;/a&gt; if or &lt;a href="http://technet.microsoft.com/en-us/library/cc732863(v=ws.10).aspx"&gt;there&lt;/a&gt; you want to learn more about DFS itself. &lt;/p&gt;
&lt;p&gt;With DFS, I wanted to create a high-available file server service, based on two file servers, each with their own physical storage. DFS replication makes sure that both file servers are kept in sync. &lt;/p&gt;
&lt;p&gt;If you setup DFS, you need to copy all the data from the original server to the secondary server. This is called &lt;a href="http://technet.microsoft.com/en-us/library/dn495044.aspx"&gt;seeding&lt;/a&gt; and I've used robocopy as recommended by Microsoft in the linked article. &lt;/p&gt;
&lt;p&gt;Seeding is not mandatory. You can just start with an empty folder on the secondary server and just have DFS replicate all files. I've experienced myself that DFS replication can be extremely slow on Windows 2008 R2. &lt;/p&gt;
&lt;p&gt;Once all files are seeded and DFS is configured, the initial replication can still takes days. Replication times are based on:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;the number of files&lt;/li&gt;
&lt;li&gt;the size of the data&lt;/li&gt;
&lt;li&gt;the performance of the disk subsystems of both source and destination&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note: windows 2012 R2 improves DFS replication dramatically, only more reason to upgrade your file servers to 2012 R2 or higher.&lt;/p&gt;
&lt;p&gt;If you seed the files, DFS will not transfer files if they are identical, thus this saves bandwidth and time. DFS checks if files differ based on their hash. So even if you seed all data, the initial replication can take a while. &lt;/p&gt;
&lt;p&gt;On our virtualised platform, the initial replication of 2.5 GB of data consisting of about five million files took about a full week. To me, that is not a very desirable outcome, but once the initial replication is done, there is no performance issue and all changes are nearly instantly replicated to the secondary server. &lt;/p&gt;
&lt;p&gt;For the particular configuration I've setup, the performance storage subsystem could contribute to the slow initial replication. &lt;/p&gt;
&lt;p&gt;To speed up the replication process, it's important that you install the &lt;a href="http://support.microsoft.com/kb/2680906"&gt;latest version of robocopy&lt;/a&gt; for Windows 2008 R2 on both systems. There is a bug in older versions of robocopy that do not properly set permissions on files. This results in file hash mismatches, causing DFS to replicate all files, nullifying the benefit of seeding. &lt;/p&gt;
&lt;p&gt;Hotfixes for &lt;a href="http://support.microsoft.com/kb/968429/en-us"&gt;Windows 2008 R2&lt;/a&gt;: 
Hotfixes for &lt;a href="http://support.microsoft.com/kb/2951262"&gt;Windows 2012 R2&lt;/a&gt;: &lt;/p&gt;
&lt;p&gt;To verify if a file on both servers has identical hashes, follow &lt;a href="http://technet.microsoft.com/en-us/library/dn495042.aspx"&gt;these instructions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you've checked a few files and assured that the hashes are identical, it's ok to configure DFS replication. If you see a lot of Event ID 4412 messages in the DFS Replication event log, there probably is an issue with the file hashes.&lt;/p&gt;</content><category term="Storage"/><category term="Windows"/><category term="DFS"/><category term="Replication"/><category term="DFS-replication"/></entry><entry><title>Monitoring HP MSA P2000 G3 I/O latency with Nagios</title><link href="https://louwrentius.com/monitoring-hp-msa-p2000-g3-io-latency-with-nagios.html" rel="alternate"/><published>2014-02-04T12:00:00+01:00</published><updated>2014-02-04T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2014-02-04:/monitoring-hp-msa-p2000-g3-io-latency-with-nagios.html</id><summary type="html">&lt;p&gt;At work we have a couple of HP MSA P2000 G3 SANs. These are entry-level SANs that still seem to have almost all features you might want from a SAN, except for official SSD-support. &lt;/p&gt;
&lt;p&gt;It seems that the new &lt;a href="http://h18006.www1.hp.com/storage/pdfs/4AA4-6608ENW.pdf"&gt;MSA 2040&lt;/a&gt; adds support for SSDs and also provides 4 GB …&lt;/p&gt;</summary><content type="html">&lt;p&gt;At work we have a couple of HP MSA P2000 G3 SANs. These are entry-level SANs that still seem to have almost all features you might want from a SAN, except for official SSD-support. &lt;/p&gt;
&lt;p&gt;It seems that the new &lt;a href="http://h18006.www1.hp.com/storage/pdfs/4AA4-6608ENW.pdf"&gt;MSA 2040&lt;/a&gt; adds support for SSDs and also provides 4 GB cache per controller instead of the somewhat meager 2GB of the P2000. &lt;/p&gt;
&lt;p&gt;Anyway, a very nice feature of the MSA P2000 G3 is the fact that the management interface also provides a well-documented API that allows you to collect detailed stats on subjects like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Overall enclosure status&lt;/li&gt;
&lt;li&gt;Reports on failed drives &lt;/li&gt;
&lt;li&gt;Controller CPU usage&lt;/li&gt;
&lt;li&gt;IOPs per controller&lt;/li&gt;
&lt;li&gt;IOPs per vdisk&lt;/li&gt;
&lt;li&gt;IOPs per disk&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://www.toms-blog.com/post/nagios-hp-msa-p2000-status-and-performance-monitor/"&gt;Thomas Weaver has written a Nagios plugin&lt;/a&gt; that does that: it collects this information and in turn you can graph it with &lt;a href="http://docs.pnp4nagios.org/start"&gt;pnp4nagios&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;In more recent firmware updates HP has added support to monitor read and write I/O latency per vdisk. Latency is an important indicator for application-level performance so I was quite happy with that. &lt;/p&gt;
&lt;p&gt;As the plugin by Thomas did not support reading these parameters yet, I spend some time implementing this check and submitted this new version of check_p2000_api.php back to Thomas. &lt;/p&gt;
&lt;p&gt;Read Latency of a RAID 6 array&lt;/p&gt;
&lt;p&gt;&lt;img alt="readlatency" src="https://louwrentius.com/static/images/msareadlatency.png" /&gt;&lt;/p&gt;
&lt;p&gt;Write Latency of a RAID 6 array&lt;/p&gt;
&lt;p&gt;&lt;img alt="readlatency" src="https://louwrentius.com/static/images/msawritelatency.png" /&gt;&lt;/p&gt;
&lt;p&gt;You will notice that the write latency of this disk array is very high at times, which seem to indicate that this vdisk is taxed too much with too many I/O-requests. &lt;/p&gt;
&lt;p&gt;I'd like to thank Thomas Weaver for writing this plugin, I think it's very useful.&lt;/p&gt;</content><category term="Storage"/><category term="Storage"/><category term="Nagios"/></entry><entry><title>An affordable server platform based on server-grade hardware</title><link href="https://louwrentius.com/an-affordable-server-platform-based-on-server-grade-hardware.html" rel="alternate"/><published>2013-12-13T12:00:00+01:00</published><updated>2013-12-13T12:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-12-13:/an-affordable-server-platform-based-on-server-grade-hardware.html</id><summary type="html">&lt;p&gt;&lt;strong&gt;Updated post (June 2014) &lt;a href="https://louwrentius.com/affordable-server-with-server-grade-hardware-part-ii.html"&gt;found HERE&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are some reasons why you should consider buying true server-grade harware when building a server, wether it's for home or business use. &lt;/p&gt;
&lt;p&gt;This is why I want to introduce you to the &lt;a href="http://www.supermicro.nl/products/motherboard/xeon/c202_c204/x9scm-f.cfm"&gt;Supermicro X9SCM-F motherboard&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="motherboard" src="http://www.supermicro.nl/a_images/products/Xeon/C204/X9SCM-F_spec.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This motherboard costs about $160 or €160, which …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;strong&gt;Updated post (June 2014) &lt;a href="https://louwrentius.com/affordable-server-with-server-grade-hardware-part-ii.html"&gt;found HERE&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are some reasons why you should consider buying true server-grade harware when building a server, wether it's for home or business use. &lt;/p&gt;
&lt;p&gt;This is why I want to introduce you to the &lt;a href="http://www.supermicro.nl/products/motherboard/xeon/c202_c204/x9scm-f.cfm"&gt;Supermicro X9SCM-F motherboard&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="motherboard" src="http://www.supermicro.nl/a_images/products/Xeon/C204/X9SCM-F_spec.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;This motherboard costs about $160 or €160, which is more than a desktop grade motherboard, but you get quite a lot in return.&lt;/p&gt;
&lt;h3&gt;Remote KVM over IP&lt;/h3&gt;
&lt;p&gt;First of all, this motherboard has a separate network interface dedicated to an on-board Keyboard-Video-Mouse interface &lt;a href="http://www.supermicro.nl/products/nfo/IPMI.cfm"&gt;(IPMI)&lt;/a&gt;. This interface allows you to power the server on or off, enter the BIOS all through a web interface, through the network. You never need to be in the vicinity of your server unless you need to perform some hardware maintenance. &lt;/p&gt;
&lt;h3&gt;Support for ECC (Error-correcting Code)  RAM&lt;/h3&gt;
&lt;p&gt;All server grade hardware from manufactures like Supermicro, Dell or HP all ship their servers with ECC RAM. This type of memory is more expensive than regular RAM, but based on the name, you may guess the benefit: it detects and corrects memory errors. If you truly care about data integrity and availability, this is a recommended feature. &lt;/p&gt;
&lt;h3&gt;Support for both cheap or faster and more expensive processors&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Cheap processor with ECC RAM support&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The cheapest solution seems to be the Intel Pentium G2030 @ 2.00 GHz. For only 72 dollar or 52 Euro it can be yours and it supports ECC memory. Performance is not stellar but sufficient for most NAS builds. More proof that a build based on ECC does not have to be expensive.&lt;/p&gt;
&lt;p&gt;One step up the ladder is the &lt;a href="http://ark.intel.com/products/65693/"&gt;Intel Core i3-3220&lt;/a&gt;. It retails for about $124 or €125 and it supports ECC memory, something I didn't suspect of the i3 series. At 3.3Ghz it's quite fast and it is a dual-core processor with hyper-threading support. The processor also supports virtualisation (VT-x), but it does not support I/O virtualisation (VT-d). &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Faster processor with full virtualisation support&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;At $229 or €200 the &lt;a href="http://ark.intel.com/products/65732/"&gt;Intel Xeon E3-1230 V2&lt;/a&gt; cost you twice the price of the Core i3, but you get twice the processor cores (quad-core) with hyper-threading, turbo-boost up to 3.7 ghz and full virtualisation support (both VT-x and VT-d). For the money, you get a beast of a processor with ECC RAM support. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Overview of CPU's&lt;/em&gt;&lt;/p&gt;
&lt;table&gt;
&lt;tr&gt;&lt;td&gt;CPU&lt;/td&gt;&lt;td&gt;Passmark score&lt;/td&gt;&lt;td&gt;Price in Euro&lt;/td&gt;&lt;td&gt;Price in Dollars&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Intel Pentium G2030 @ 3.00GHz&lt;/td&gt;&lt;td&gt;3008&lt;/td&gt;&lt;td&gt;52 Euro&lt;/td&gt;&lt;td&gt;72 Dollar*&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Intel Core i3-3220 @ 3.30GHz&lt;/td&gt;&lt;td&gt;4226&lt;/td&gt;&lt;td&gt;97 Euro&lt;/td&gt;&lt;td&gt;125 Dollar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Intel Xeon E3-1230 V2 @ 3.30GHz&lt;/td&gt;&lt;td&gt;8890&lt;/td&gt;&lt;td&gt;196 Euro&lt;/td&gt;&lt;td&gt;230 Dollar&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;ul&gt;
&lt;li&gt;Dollars are from Newegg (* is estimate).&lt;/li&gt;
&lt;li&gt;Euros are including taxes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Support for 32 GB RAM&lt;/h3&gt;
&lt;p&gt;32 GB is quite some RAM and the maximum amount supported by the free version of VMware ESXi (ESXi 5.5 does not have this limit I've been told). Basically, it supports entry-level virtualisation needs or web-application needs. The 32 GB RAM limit is one of the biggest constraints of this platform, but may be sufficient for most applications except for large virtualisation loads or big databases. &lt;/p&gt;
&lt;p&gt;32 GB is more than enough for everyone who likes to build a beefy storage server. &lt;/p&gt;
&lt;h3&gt;Expandability: 4 x PCI-e 8x (physical size) slots&lt;/h3&gt;
&lt;p&gt;This is probably why the &lt;a href="http://www.supermicro.nl/products/motherboard/xeon/c202_c204/x9scm-f.cfm"&gt;Supermicro X9SCM-F motherboard&lt;/a&gt; is so interesting for NAS or storage builders. It has four PCI-e slots in a 8x physical form factor. Two of them are PCI-e 2.0 4x in a physical 8x slot and the other two are true PCI-e 3.0 8x slots. But even a PCI-e 2.0 4x slot provides you with 4 x 500 MB/s = 2000 MB/s per slot. The 8x slots have 8 lanes at 985 MB/s each thus totalling almost 8 GB/s! Let's be honest: the PCI-e 2.0 4x provide more than enough bandwidth to power any disk controller or network interface.&lt;/p&gt;
&lt;p&gt;Because there are four slots, there are several possibilities. For example, you could populate them with four &lt;a href="http://www.redbooks.ibm.com/abstracts/tips0740.html"&gt;IBM M1015 HBA's&lt;/a&gt; providing you with 32 SAS/SATA ports for a total of 32 disks. With the six on-board SATA ports, you could theoretically connect 38 disks. &lt;/p&gt;
&lt;p&gt;If you put only 3 x &lt;a href="http://www.redbooks.ibm.com/abstracts/tips0740.html"&gt;IBM M1015 HBA's&lt;/a&gt; in the motherboard you will leave room for fast networking, like a quad-port gigabit network card. You can then put the four gigabit ports into &lt;a href="https://louwrentius.com/linux-network-interface-bonding-trunking-or-how-to-get-beyond-1-gbs.html"&gt;Linux interface bonding&lt;/a&gt; to achieve 400 MB/s network transfer speeds. &lt;/p&gt;
&lt;p&gt;&lt;img alt="motherboard" src="https://louwrentius.com/static/images/3xm1015-in-X9SCM-F.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;You could also consider to implement 10GB network cards (more expensive) or take a look into fibre channel or infiniband network connectivity. &lt;/p&gt;
&lt;p&gt;With those four PCI-e slots, you can come a very long way. &lt;/p&gt;
&lt;h3&gt;Two on-board Gigabit network interfaces&lt;/h3&gt;
&lt;p&gt;The motherboard supports two on-board network interfaces and you can use them to &lt;a href="https://louwrentius.com/linux-network-interface-bonding-trunking-or-how-to-get-beyond-1-gbs.html"&gt;bond&lt;/a&gt; them together for extra performance and/or fail-over. &lt;/p&gt;
&lt;p&gt;You could also use one interface for regular LAN traffic and the other one for iSCSI or other protocols. &lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;I believe the &lt;a href="http://www.supermicro.nl/products/motherboard/xeon/c202_c204/x9scm-f.cfm"&gt;Supermicro X9SCM-F motherboard&lt;/a&gt; is a very interesting all-round platform for any type of server and particularly interesting as a platform for storage servers. &lt;/p&gt;
&lt;p&gt;If you take the motherboard ($160), 8 GB RAM ($75) and entry level processor ($125) you get a server-grade platform for $360. The same platform with 16 GB RAM will cost you about $435. The prices in Euros will be about the same.&lt;/p&gt;</content><category term="Storage"/><category term="storage"/></entry><entry><title>Script that shows smart values of all disks'</title><link href="https://louwrentius.com/script-that-shows-smart-values-of-all-disks.html" rel="alternate"/><published>2013-10-05T01:00:00+02:00</published><updated>2013-10-05T01:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-10-05:/script-that-shows-smart-values-of-all-disks.html</id><summary type="html">&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Please use &lt;a href="https://github.com/louwrentius/showtools"&gt;this tool on github&lt;/a&gt; instead of this ancient script.&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;So you have a Linux system with a lot of hard drives. If you want to quickly check on some key SMART values to determine the health of individual disks, you might be interested in this script.&lt;/p&gt;
&lt;p&gt;I wrote …&lt;/p&gt;</summary><content type="html">&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Please use &lt;a href="https://github.com/louwrentius/showtools"&gt;this tool on github&lt;/a&gt; instead of this ancient script.&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;So you have a Linux system with a lot of hard drives. If you want to quickly check on some key SMART values to determine the health of individual disks, you might be interested in this script.&lt;/p&gt;
&lt;p&gt;I wrote a small Python script called &lt;a href="https://louwrentius.com/files/showsmart"&gt;'showsmart'&lt;/a&gt; that displays key SMART values for all disks that support SMART. This has been tested on Ubuntu and Debian.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/showsmart.png"&gt;&lt;img alt="showsmart" src="https://louwrentius.com/static/images/showsmart.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;REALLOC. = Reallocated Sector Count &lt;/li&gt;
&lt;li&gt;PENDING = Current Pending Sector&lt;/li&gt;
&lt;li&gt;CRC ERR. = UDMA CRC ERROR&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This script only requires python and smartctl (smartmontools).&lt;/p&gt;
&lt;p&gt;I hope someone will find it useful.&lt;/p&gt;</content><category term="Storage"/><category term="Storage"/><category term="Python"/><category term="Script"/><category term="smartctl"/></entry><entry><title>Script that shows relevant disk information</title><link href="https://louwrentius.com/script-that-shows-relevant-disk-information.html" rel="alternate"/><published>2013-10-02T01:00:00+02:00</published><updated>2013-10-02T01:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-10-02:/script-that-shows-relevant-disk-information.html</id><content type="html">&lt;p&gt;I wrote a small Python script called &lt;a href="https://louwrentius.com/files/showdisks"&gt;'showdisks'&lt;/a&gt; that displays relevant information about any physical storage devices supported by hdparm. &lt;/p&gt;
&lt;p&gt;Information such as model and capacity are shown, but also controller and device path.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/showdisks01.png"&gt;&lt;img alt="showdisks" src="https://louwrentius.com/static/images/showdisks01.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This script only requires python and hdparm.&lt;/p&gt;
&lt;p&gt;I hope someone will find it useful.&lt;/p&gt;</content><category term="Storage"/><category term="Storage"/><category term="Python"/><category term="Script"/></entry><entry><title>Using iSCSI with time machine and Super Duper</title><link href="https://louwrentius.com/using-iscsi-with-time-machine-and-super-duper.html" rel="alternate"/><published>2013-07-21T16:00:00+02:00</published><updated>2013-07-21T16:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-07-21:/using-iscsi-with-time-machine-and-super-duper.html</id><summary type="html">&lt;p&gt;In the past, as a Mac user, I've used separate external drives for Time Machine backups and Super Duper clones but I'm not happy with that. External hard drives make noise and create clutter.&lt;/p&gt;
&lt;p&gt;I'd like to move away all my storage from my living room (or home office) and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;In the past, as a Mac user, I've used separate external drives for Time Machine backups and Super Duper clones but I'm not happy with that. External hard drives make noise and create clutter.&lt;/p&gt;
&lt;p&gt;I'd like to move away all my storage from my living room (or home office) and put it in another room or even closet. &lt;/p&gt;
&lt;p&gt;A NAS may help with that but a NAS does not solve all problems. The main problem being the reliability of network-based Time Machine backups. Those NAS devices pretend to be Time Capsules, but there's always the risk that Apple breaks compatibility with a future update. &lt;/p&gt;
&lt;p&gt;&lt;img alt="qnap nas" src="https://louwrentius.com/static/images/qnapnas01.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;From my experience, Time Machine backups are only 100% reliable with local attached storage - like external hard drives. &lt;/p&gt;
&lt;p&gt;Now there is a cool technology called iSCSI. It's basically a storage protocol tunneled through your home LAN network instead of a USB / Firewire or Thunderbolt cable. Most NAS devices support iSCSI and allow you to carve out some local NAS storage and present it to your computer through the network as if it was just local storage. Since iSCSI uses your Gigabit network as a transport, you can achieve transfer speeds of around ~110 MB/s easily, which should suit most needs*.&lt;/p&gt;
&lt;p&gt;This is very cool, because you can export entire hard drives through the network to your computer. Your computer does not see the difference between an external USB hard drive and a hard drive exported through your NAS to your computer. iSCSI is totally transparent from the perspective of the operating system.&lt;/p&gt;
&lt;p&gt;This trick allows you to create &lt;em&gt;bootable&lt;/em&gt; Super Duper clones of your boot drive through the network. I would just hook up an external USB drive to my NAS and export it through iSCSI.&lt;/p&gt;
&lt;p&gt;In case of an emergency - when your boot drive dies - you can boot from this external hard drive. Just disconnect it from your NAS and hook it up to your Mac. &lt;/p&gt;
&lt;p&gt;Because hard drives attached through iSCSI are seen as normal storage, you can also encrypt them with the Apple build-int whole-drive (or whole-partition) encryption. &lt;/p&gt;
&lt;p&gt;Now there is one caveat. Mac OS X does not natively support iSCSI, it has no native iSCSI initiator (client). In contrast, Windows 7 does have a very good iSCSI initiator. I think it's a shame, but Mac users must buy an iSCSI initiator from either:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.studionetworksolutions.com/globalsan-iscsi-initiator/"&gt;GlobalSAN for $89&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.attotech.com/products/product.php?scat=17&amp;amp;sku=INIT-MAC0-001"&gt;Atto for $195&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I've only used the GlobalSAN iSCSI initiator and it seems to work fine. I 
believe that $89 is well worth the money: all your storage tucked away from your home office or living room.&lt;/p&gt;
&lt;p&gt;Another caveat is that iSCSI requires reliable networking or otherwise there is a possible risk of data corruption, so I would not advice using iSCSI over a wireless network connection, although it is possible.&lt;/p&gt;
&lt;p&gt;For the most popular NAS vendors, I've added some tutorials on how to setup iSCSI.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="http://www.synology.nl/support/tutorials_show.php?q_id=468"&gt;Synology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.qnap.com/index.php?lang=en&amp;amp;sn=2698"&gt;QNAP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.thecus.com/download/howtoguide/HowtoCreateaniSCSITargetonThecusNAS.pdf"&gt;Thecus&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;P.S.
The GlobalSAN iSCSI initiator does support sleep and hibernate, in contrast to what some tutorials may tell you.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Improving iSCSI Native Multi Pathing Round Robin performance</title><link href="https://louwrentius.com/improving-iscsi-native-multi-pathing-round-robin-performance.html" rel="alternate"/><published>2013-05-27T00:00:00+02:00</published><updated>2013-05-27T00:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-05-27:/improving-iscsi-native-multi-pathing-round-robin-performance.html</id><summary type="html">&lt;p&gt;10 Gb ethernet is still quite expensive. You not only need to buy appropriate NICS, but you must also upgrade your network hardware as well. You may even need to replace existing fiber optic cabling if it's not rated for 10 Gbit. &lt;/p&gt;
&lt;p&gt;So I decided to still just go for …&lt;/p&gt;</summary><content type="html">&lt;p&gt;10 Gb ethernet is still quite expensive. You not only need to buy appropriate NICS, but you must also upgrade your network hardware as well. You may even need to replace existing fiber optic cabling if it's not rated for 10 Gbit. &lt;/p&gt;
&lt;p&gt;So I decided to still just go for plain old 1 Gbit iSCSI based on copper for our backup SAN. After some research I went for the HP MSA P2000 G3 with dual 1 Gbit iSCSI controllers.&lt;/p&gt;
&lt;p&gt;Each controller has 4 x 1 Gbit ports, so the box has a total of 8 Gigabit ports. 
This is ideal for redundancy, performance and cost. This relatively cheap SAN does support active/active mode, so both controllers can share the I/O load. &lt;/p&gt;
&lt;p&gt;The problem with storage is that a single 1 Gbit channel is just not going to cut it when you need to perform bandwidth intensive tasks, such as moving VMs between datastores (within VMware).&lt;/p&gt;
&lt;p&gt;Fortunately, iSCSI Multi Pathing allows you to do basically a RAID 0 over multiple network cards, combining their performance. So four 1 Gbit NICS can provide you with 4 Gbit of actual storage throughput. &lt;/p&gt;
&lt;p&gt;The trick is not only to configure iSCSI Multi Pathing using regular tutorials, but also to enable the Round Robin setting on each data store or each RAW device mapping. &lt;/p&gt;
&lt;p&gt;So I dit all this and still I got less than 1 Gb/s performance, but fortunately, there is only one little trick to get to the actual performance you might expect.&lt;/p&gt;
&lt;p&gt;I found this at multiple locations but the explanation on &lt;a href="http://jpaul.me/?p=2492"&gt;Justin's IT Blog&lt;/a&gt;
is best. &lt;/p&gt;
&lt;p&gt;By default, VMware issues 1000 IOPS to a NIC before switching (Round Robin) to the next one. This really hampers performance. You need to set this value to 1. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;esxcli storage nmp psp roundrobin deviceconfig set -d $DEV --iops 1 --type iops
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This configuration tweak is &lt;a href="http://h20195.www2.hp.com/V2/GetPDF.aspx/4AA1-2185ENW.pdf"&gt;recommended by HP&lt;/a&gt;, see page 28 of the linked PDF. &lt;/p&gt;
&lt;p&gt;Once I configured all iSCSI paths to this setting, I got 350 MB/s of sequential write performance from a single VM to the datastore. That's decent enough for me.&lt;/p&gt;
&lt;p&gt;How do you do this? It's a simple one liner that sets the iops value to 1, but I'm so lazy, I don't want to copy/past devices and run the command by hand each time. &lt;/p&gt;
&lt;p&gt;I used a simple CLI script (VMware 5) to configure this setting for all devices.
SSH to the host and then run this script: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;for x in `esxcli storage nmp device list | grep ^naa`
do
    echo &amp;quot;Configuring Round Robin iops value for device $x&amp;quot;
    esxcli storage nmp psp roundrobin deviceconfig set -d $x --iops 1 --type iops
done
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is not the exact script I used, I have to verify this code, but basically it just configures this value for all storage devices. Devices that don't support this setting will raise an error message that can be ignored (if the VMware host also has some local SAS or SATA storage, this is expected). &lt;/p&gt;
&lt;p&gt;The next step is to check if this setting is permanent and survives a host reboot.&lt;/p&gt;
&lt;p&gt;Anyway, I verified the performance using a Linux VM and just writing a simple test file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;dd if=/dev/zero of=/storage/test.bin bs=1M count=30000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To see the Multi Pathing + Round Robin in action, run esxtop at the cli and then press N. You will notice that with four network cards, VMware will use all four channels available.&lt;/p&gt;
&lt;p&gt;This all is to say that plain old 1 Gbit iSCSI can still be fast. But I believe that 10 Gbit ethernet does probably provide better latency. If that's really an issue for your environment, is something I can't tell. &lt;/p&gt;
&lt;p&gt;Changing the IOPS parameter to 1 IOPS also seems to improve random I/O performance, according to the table in &lt;a href="http://jpaul.me/?p=2492"&gt;Justin's post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Still, although 1 Gbit iSCSI is cheap, it may be more difficult to get the appropriate performance levels you need. If you have time, but little money, it may be the way to go. However, if time is not on your side and money isn't the biggest problem, I would definitely investigate the price difference with going for fibre channel or with 10Gbit iSCSI.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Creating storage benchmark charts with FIO and GNUplot</title><link href="https://louwrentius.com/creating-storage-benchmark-charts-with-fio-and-gnuplot.html" rel="alternate"/><published>2013-05-22T20:00:00+02:00</published><updated>2013-05-22T20:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-05-22:/creating-storage-benchmark-charts-with-fio-and-gnuplot.html</id><summary type="html">&lt;hr&gt;

&lt;p&gt;&lt;strong&gt;Edit 2019&lt;/strong&gt;: I've made a &lt;a href="https://louwrentius.com/fio-plot-creating-nice-charts-from-fio-storage-benchmark-data.html"&gt;new tool&lt;/a&gt; called &lt;a href="https://github.com/louwrentius/fio-plot"&gt;'fio-plot'&lt;/a&gt;to create various graphs. &lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;I use &lt;a href="http://freecode.com/projects/fio"&gt;FIO&lt;/a&gt; to perform storage IO performance benchmarks. FIO does provide a script called "fio_generate_plots" which generates PNG or JPG based charts based on the data generated by FIO. The charts are created with &lt;a href="http://www.gnuplot.info"&gt;GNUplot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The …&lt;/p&gt;</summary><content type="html">&lt;hr&gt;

&lt;p&gt;&lt;strong&gt;Edit 2019&lt;/strong&gt;: I've made a &lt;a href="https://louwrentius.com/fio-plot-creating-nice-charts-from-fio-storage-benchmark-data.html"&gt;new tool&lt;/a&gt; called &lt;a href="https://github.com/louwrentius/fio-plot"&gt;'fio-plot'&lt;/a&gt;to create various graphs. &lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;I use &lt;a href="http://freecode.com/projects/fio"&gt;FIO&lt;/a&gt; to perform storage IO performance benchmarks. FIO does provide a script called "fio_generate_plots" which generates PNG or JPG based charts based on the data generated by FIO. The charts are created with &lt;a href="http://www.gnuplot.info"&gt;GNUplot&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The "fio_generate_plots" didn't make me very happy as it didn't generate the kind of graphs I wanted. Furthermore, the script just contains some copy/pastes of the same blocks of code, slightly altered for the different benchmark types. I understand that the focus lies on FIO itself not some script to generate some fancy graphs, so don't get me wrong, but the script could be improved.&lt;/p&gt;
&lt;p&gt;I used this script as the basis for a significantly reworked version, putting the code in a function that can be called with different parameters for the different benchmark types. &lt;/p&gt;
&lt;p&gt;The result of this new script is something like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt="benchmark" src="https://louwrentius.com/static/images/fio/Random-4K-write-performance-iops.svg" /&gt;&lt;/p&gt;
&lt;p&gt;You can &lt;a href="https://louwrentius.com/files/fio_generate_plots_reworked.sh"&gt;download this new script here&lt;/a&gt;. This script requires GNUplot 4.4 or higher.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 2013/05/26&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I've submitted the script as a patch to the maintainers of FIO and it has been &lt;a href="http://git.kernel.dk/?p=fio.git;a=commitdiff;h=b35c036c8db9ece002b019f4a462a303ceb130fa;hp=4ac23d27a5e5dea73c4db4a4fcc46a6afe645bd0"&gt;committed&lt;/a&gt; to the source tree. I'm not sure how this will work out but I assume that this script will be part of newer FIO releases. &lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Storage and I/O: reads vs. writes</title><link href="https://louwrentius.com/storage-and-io-reads-vs-writes.html" rel="alternate"/><published>2013-04-02T00:00:00+02:00</published><updated>2013-04-02T00:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-04-02:/storage-and-io-reads-vs-writes.html</id><summary type="html">&lt;p&gt;There is a fundamental difference between a read operation and a write operation. Storage can lie about completing a write operation, but it can never lie about completing a read operation. Therefore read and writes have different characteristics. This is what I've learned.&lt;/p&gt;
&lt;h3&gt;About writes&lt;/h3&gt;
&lt;p&gt;So what does this mean …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is a fundamental difference between a read operation and a write operation. Storage can lie about completing a write operation, but it can never lie about completing a read operation. Therefore read and writes have different characteristics. This is what I've learned.&lt;/p&gt;
&lt;h3&gt;About writes&lt;/h3&gt;
&lt;p&gt;So what does this mean? Well, if you write data to disk, the I/O subsystem only has to acknowledge that it has written the data to the actual medium. Basically, the application says "please write this data to disk" and the I/O subsystem answers "done, feel free to give me another block of data!". &lt;/p&gt;
&lt;p&gt;But the application cannot be sure that the I/O subsystem actually wrote that data to disk. More likely, the application can be sure the I/O subsystem lied.&lt;/p&gt;
&lt;p&gt;Compared to RAM, non-volatile storage like hard-drives are slow. Orders of magnitudes slower. And the worst-case scenario, which is often also the real-life scenario, is that both read and write patterns are random as perceived from the storage I/O subsystem. &lt;/p&gt;
&lt;p&gt;So you have this mechanical device with rotating platters and a moving arm, governed by Newtons rules of physics, trying to compete with CPUs and memory that are so small that they are affected by quantum mechanical effects. No way that device is going to be able to keep up with that. &lt;/p&gt;
&lt;p&gt;So the I/O subsystem cheats. Hard drives are relatively great at reading and writing blocks of data sequentially, it's the random access patterns that wreaks havoc on performance. So the trick is to lie to the application and collect a bunch of writes in a cache, in memory. &lt;/p&gt;
&lt;p&gt;So, meanwhile, the I/O subsystem looks at the data to be written to disk, and reorders the write operations, so that it becomes as 'serialised' as possible. It tries to take into account all the latencies involved in moving the arm, timing that with the rotation of the platter and that kind of stuff.&lt;/p&gt;
&lt;p&gt;A 7200 RPM hard drive can do only 75 IOPS with random access patterns, but that is a worst-case of worst-case scenario's. Real-life usage scenario's often allow for some optimalisation. &lt;/p&gt;
&lt;p&gt;I used FIO to perform some random-IO performance benchmarks on different hard drive types and RAID configurations. It turns out that read performance was conform the 75 IOPS, but writes where in the thousands of IOPS, not a realistic figure. The operating system (Linux) employed heavy caching of the writes, lying to FIO about the actual IOPS being written to disk. &lt;/p&gt;
&lt;p&gt;Thousands of IOPS sounds great, but you can only lie until your write cache is full. There comes a time when you have to actually deliver and write this data to disk. This is where you see large drops in performance, to almost zero IOPS.&lt;/p&gt;
&lt;p&gt;Most of the time, this behaviour is overall beneficial to application performance, as long as the application usage patterns are often short bursts of data, that need to be written to disk. With more steady streams of data being written to disk in a random order, this might influence application responsiveness. The application might become periodically unresponsive as data is flushed from the cache to disk.&lt;/p&gt;
&lt;p&gt;This write-caching behaviour is often desired, because by reordering and optimising the order of the write requests, the actual overall obtained random I/O write performance is often significantly higher than could be achieved by the disk subsystem itself. &lt;/p&gt;
&lt;p&gt;If the disk subsystem is not just a single disk, but a RAID array, comprised of
multiple drives, write-caching is often even more important to keep performance acceptable, especially for RAID arrays with parity, such as RAID 5 and RAID 6.&lt;/p&gt;
&lt;p&gt;Write-back caching may help increase performance significantly, but it may come at a cost. As the I/O subsystem lies about data being written to disk, that data may get lost if the system crashes or loses power. There is a risk of data loss or data corruption. Only use write-back caching on equipment that is supported by battery backup units and a UPS. Due to the risks associated with write-back caching, there might be use cases where it might be advised not to enable it to retain data consistency. &lt;/p&gt;
&lt;h3&gt;About reads&lt;/h3&gt;
&lt;p&gt;The I/O subsystem can't lie to the application about reads. If the application 
asks the I/O subsystem "can I have the contents of file X", the I/O subsystem can't just say "well, yes, sure". It actually has to deliver that data. So any arbitrary write can be easily cached and written to disk in a more optimised way, reads may be harder. There is no easy way out, the I/O subsystem must deliver.&lt;/p&gt;
&lt;p&gt;Where any arbitrary write can be cached, only a limited number of reads can be cached. Cache memory is relatively small compared to the storage of the disk subsystem. The I/O subsystem must be smart about which data needs to be cached.&lt;/p&gt;
&lt;p&gt;More complex storage solutions keep track of 'hot spots' and keep that data cached. As a side note, such caching constructions can now also be found in consumer grade equipment: Apple's fusion drive uses the SSD as a cache and stores the data that is less frequently accessed on the HDD.&lt;/p&gt;
&lt;p&gt;But in the end, regarding reads, chances are higher that data must be retrieved that is not stored in cache (cache miss) and thus the drives must do actual work. Fortunately, that work is not as 'expensive' as writes for RAID 5 or RAID 6 arrays. &lt;/p&gt;
&lt;p&gt;Furthermore, reads can also be 'grouped' and serialised (increased queue depth) at the cost of latency to optimise them (setup a more sequential read access pattern for the disk subsystem) and achieve better performance. But again, at the cost of latency, thus responsiveness. That may or
may not be a problem depending of the type of application. &lt;/p&gt;
&lt;h3&gt;Some remarks&lt;/h3&gt;
&lt;p&gt;If possible, it's better to try and avoid having to access the storage subsystem in the first place, if possible. Try and trow RAM memory at the problem. Buy systems with sufficient RAM memory, so that the entire database fits in RAM memory. A few years ago this was unthinkable, but 128 GB of RAM memory can be had for less than two thousand dollars.&lt;/p&gt;
&lt;p&gt;If RAM isn't an option (dataset is too large) still try and put in as much RAM as possible. Also, try and see if server grade Solid State Drives (SSDs) are an option (always RAID 1 at least for redundancy!), although their cost may be an obstacle.&lt;/p&gt;
&lt;p&gt;The gateway of last resort is the old trusted hard drive. If random I/O is really an issue, take a look at 15000 RPM or at least 10000 RPM SAS drives and a good RAID controller with loads of cache memory. In general, more drives or more 'spindles' equals more I/O performance.&lt;/p&gt;
&lt;p&gt;You might encounter a situation where you want to add drives to increase I/O performance, not for the storage. More important: you may choose not to use that extra storage as it may decrease performance. Because if you put more data on a disk, the head must cover larger areas of the disk platter, increasing latency. &lt;/p&gt;
&lt;p&gt;There are usecases where drives are intentionally under-partitioned to (artificially) increase the performance of the drives.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Benchmark results of Random I/O performance of different RAID levels</title><link href="https://louwrentius.com/benchmark-results-of-random-io-performance-of-different-raid-levels.html" rel="alternate"/><published>2013-01-01T00:00:00+01:00</published><updated>2013-01-01T00:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2013-01-01:/benchmark-results-of-random-io-performance-of-different-raid-levels.html</id><summary type="html">&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I have performed some benchmarks to determine how different RAID levels perform when handling a 100% random workload of 4K requests. This is a worst-case scenario for almost every storage subsystem. Normal day-to-day workloads may not be that harsh in a real-life environment, but worst-case, these tests show what …&lt;/p&gt;</summary><content type="html">&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I have performed some benchmarks to determine how different RAID levels perform when handling a 100% random workload of 4K requests. This is a worst-case scenario for almost every storage subsystem. Normal day-to-day workloads may not be that harsh in a real-life environment, but worst-case, these tests show what kind of performance you might expect when you face such a workload. &lt;/p&gt;
&lt;p&gt;To create a worst-case worst-case solution, I even disabled write-caching for all write-related tests.&lt;/p&gt;
&lt;p&gt;At the moment, I only have access to some consumer-level test hardware. In the future, I'd like to rerun these tests on some 10K RPM SAN storage drives to see how this turns out. &lt;/p&gt;
&lt;h3&gt;RAID levels tested&lt;/h3&gt;
&lt;p&gt;I have tested the following RAID levels:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;RAID 0&lt;/li&gt;
&lt;li&gt;RAID 10&lt;/li&gt;
&lt;li&gt;RAID 5&lt;/li&gt;
&lt;li&gt;RAID 6&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Test setup&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;CPU: Intel Core i5 2400s @ 2.5 GHz&lt;/li&gt;
&lt;li&gt;RAM: 4 GB&lt;/li&gt;
&lt;li&gt;Drives: 6 x 500 GB, 7200 RPM drives (SATA). &lt;/li&gt;
&lt;li&gt;Operating system: Ubuntu Linux&lt;/li&gt;
&lt;li&gt;RAID: Build-in Linux software RAID (MDADM)&lt;/li&gt;
&lt;li&gt;File system: XFS&lt;/li&gt;
&lt;li&gt;Test file size: 10 GB&lt;/li&gt;
&lt;li&gt;Test software: &lt;a href="http://freecode.com/projects/fio"&gt;FIO&lt;/a&gt; &lt;a href="https://louwrentius.com/files/random-read-template.fio"&gt;read-config&lt;/a&gt; &amp;amp; &lt;a href="https://louwrentius.com/files/random-write-template.fio"&gt;write-config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Queue depth: 4&lt;/li&gt;
&lt;li&gt;&lt;a href="https://louwrentius.com/files/raid-tester.sh"&gt;Test script&lt;/a&gt; that generates RAID arrays, file systems and runs the tests.&lt;/li&gt;
&lt;li&gt;Cache: all write caching was disabled during testing (see script)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Test results&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-read-performance-lat.svg"&gt;&lt;img alt="read latency" src="https://louwrentius.com/static/images/fio/Random-4K-read-performance-lat.svg" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-read-performance-iops.svg"&gt;&lt;img alt="read iops" src="https://louwrentius.com/static/images/fio/Random-4K-read-performance-iops.svg" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-read-performance-bw.svg"&gt;&lt;img alt="read bw" src="https://louwrentius.com/static/images/fio/Random-4K-read-performance-bw.svg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-write-performance-lat.svg"&gt;&lt;img alt="write latency" src="https://louwrentius.com/static/images/fio/Random-4K-write-performance-lat.svg" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-write-performance-iops.svg"&gt;&lt;img alt="write iops" src="https://louwrentius.com/static/images/fio/Random-4K-write-performance-iops.svg" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/fio/Random-4K-write-performance-bw.svg"&gt;&lt;img alt="write bw" src="https://louwrentius.com/static/images/fio/Random-4K-write-performance-bw.svg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also tested various chunk sizes for each RAID level. These are the results for RAID 10.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://louwrentius.com/static/images/fio/RAID-chunk-size-and-read-performance-iops.svg"&gt;&lt;img alt="read iops chunk" src="https://louwrentius.com/static/images/fio/RAID-chunk-size-and-read-performance-iops.svg" /&gt;&lt;/a&gt;
&lt;a href="https://louwrentius.com/static/images/fio/RAID-chunk-size-and-write-performance-iops.svg"&gt;&lt;img alt="write iops chunk" src="https://louwrentius.com/static/images/fio/RAID-chunk-size-and-write-performance-iops.svg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you don't see any images, you are not using Internet Explorer 9, or a recent version of Google Chrome, Mozilla Firefox or Apple Safari.&lt;/p&gt;
&lt;h3&gt;Analysis&lt;/h3&gt;
&lt;p&gt;With this kind of testing, there are so many variables that it will be difficult to make any solid observations. But these results are interesting. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Results are in line with reality&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;First of all, the results do not seem unexpected. Six drives at 7200 RPM should each provide about 75 IOPS. This should result in a total of 450 IOPS for the entire array. The read performance does show exactly this kind of performance. &lt;/p&gt;
&lt;p&gt;With all caching disabled, write performance is worse. And especially the RAID levels with parity (RAID 5 and RAID 6) show a significant drop in performance when it comes to random writes. RAID 6 write performance got so low and erratic that I wonder if there is something wrong with the driver or the setup. Especially the I/O latency is off-the-charts with RAID 6, so there must be something wrong. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Read performance is equal for all RAID levels&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;However, the most interesting graphs are about IOPS and latency. Read performance of all different RAID arrays is almost equal. RAID 10 seems to have the upper hand in all read benchmarks. I'm not sure why this is. Both bandwidth and latency are better than the other RAID levels. I'm really curious about a good technical explanation about why this should be expected. &lt;em&gt;Edit&lt;/em&gt;: RAID10 is basically multiple RAID 1 sets stuck together. Data is striped across RAID 1 sets. When reading, a single stripe can be deliverd by both disks in the particular RAID mirror it resides on, thus there is a higher risk that one of the heads is in the vicinity of the requested sector.&lt;/p&gt;
&lt;p&gt;RAID 0 is not something that should be used in a production environment, but it is included to provide a comparison for the other RAID levels. The IOPS graph regarding write performance is most telling. With RAID 10 using 6 drives, you only get the effective IOPS of 3 drives, thus about 225 IOPS. This is exactly what the graph is showing us. &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Raid with parity suffers regarding write performance&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;RAID 5 needs four write I/Os for every application-level write request. So with 6 x 75 = 450 IOPS divided by 4, we get 112,5 IOPS. This is also on par with the graph. This is still ok, but notice the latency: it is clearly around 40 milliseconds, whereas 20 milliseconds is the rule of thumb where performance will start to significantly degrade.&lt;/p&gt;
&lt;p&gt;RAID 6 needs six write I/Os for every application-level write request. So with 450 IOPS total, divided by 6, we only have single-disk performance of 75 IOPS. If we average the line, we do approximately get this performance, but the latency is so erratic that it would not be usable.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;RAID chunk size and performance&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So I was wondering if the RAID array chunk size does impact random I/O performance. It seems not. &lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;Overall, the results seem to indicate that the actual testing itself is realistic. We do get figures that are in tune with theoretical results. &lt;/p&gt;
&lt;p&gt;The erratic RAID 6 write performance would need a thorougher explanation, one that I can't give. &lt;/p&gt;
&lt;p&gt;Based on the test results, it seems that random I/O performance for a single test file is not affected by the chunk size or stripe size of an RAID array.&lt;/p&gt;
&lt;p&gt;The results show to me that my benchmarking method provides a nice basis for further testing. &lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Understanding IOPS, latency and storage performance</title><link href="https://louwrentius.com/understanding-iops-latency-and-storage-performance.html" rel="alternate"/><published>2012-11-25T21:00:00+01:00</published><updated>2012-11-25T21:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2012-11-25:/understanding-iops-latency-and-storage-performance.html</id><summary type="html">&lt;hr&gt;
&lt;p&gt;Update 2020: I've written &lt;a href="https://louwrentius.com/understanding-storage-performance-iops-and-latency.html"&gt;another blogpost&lt;/a&gt; about this topic, including some benchmark examples.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;When most people think about storage performance, they think about throughput. But throughput is similar to the top speed of a car. In reality, you will almost never reach the top speed of your car (unless you …&lt;/p&gt;</summary><content type="html">&lt;hr&gt;
&lt;p&gt;Update 2020: I've written &lt;a href="https://louwrentius.com/understanding-storage-performance-iops-and-latency.html"&gt;another blogpost&lt;/a&gt; about this topic, including some benchmark examples.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;When most people think about storage performance, they think about throughput. But throughput is similar to the top speed of a car. In reality, you will almost never reach the top speed of your car (unless you are living in Germany). And that's fine, because in most situations that's not so relevant. &lt;/p&gt;
&lt;p&gt;For instance, properties like how fast your car accelerates and how well the car handles bends and corners are often more important than its top speed. And this example also holds for storage performance. &lt;/p&gt;
&lt;p&gt;Most people know that SSDs are often way faster than regular mechanical hard drives. But it's not about the throughput of these devices. Its all about Input/Output operations per second (IOPS). If you can handle a high number of IOPS, that is great for real life application performance. But IOPS does not tell you the whole story. To be more precise: IOPS is a meaningless figure unless tied to an average latency and a certain request size (how much data is processed with the I/O). Let's first focus on IOPS and Latency and talk about the request size later.&lt;/p&gt;
&lt;p&gt;&lt;img alt="latency" src="https://louwrentius.com/static/images/io03.png" /&gt;&lt;/p&gt;
&lt;p&gt;Latency is how fast a single I/O-request is handled. This is very important, because a storage subsystem that can handle 1000 IOPS with an average latency of 10ms may get better application performance than a subsystem that can handle 5000 IOPS with an average latency of 50ms. Especially if the application is sensitive to latency, such as a database service. &lt;/p&gt;
&lt;p&gt;This is a very important thing to understand: how IOPS and latency relate to each other. Here, the car analogy probably breaks down. We need a different one to better understand what is going on. So picture you are in a super market. This is a special supermarket, where customers (I/Os) are served by cashiers (disk) at an average speed of 10ms. If you divide one second with 10ms, we understand that this cashier can handle 100 customers per second. But only one at a time, in succession. &lt;/p&gt;
&lt;p&gt;&lt;img alt="serial" src="https://louwrentius.com/static/images/io04.png" /&gt;&lt;/p&gt;
&lt;p&gt;It is clear that although the cashier can handle 100 customers per second, he cannot handle them at the same time! So when a customer arrives at the register, and within those 10ms handling time, a second customer arrives, that customer must wait. Once the waiting customer is handled by the cashier, handling of that customer still takes just 10ms, but the overal processing time was maybe 15ms or worst case (two customers arriving at the same time) even 20ms.&lt;/p&gt;
&lt;p&gt;&lt;img alt="queue" src="https://louwrentius.com/static/images/io055.png" /&gt;&lt;/p&gt;
&lt;p&gt;So it is very important to understand that although a disk may handle individual I/Os with an average latency of 10ms, the actual latency as perceived by the application may be higher as some I/Os must wait in line. &lt;/p&gt;
&lt;p&gt;This example also illustrates that waiting in line increases the latency for a particular I/O to be handled. So if you increase the Read I/O queue, you will notice that the average latency will increase. Longer queues will mean higher latency, but also more IOPS!!!&lt;/p&gt;
&lt;p&gt;&lt;img alt="queue 4" src="https://louwrentius.com/static/images/io02.png" /&gt;&lt;/p&gt;
&lt;p&gt;How is that possible? How can a disk drive suddenly do more random IOPs at the cost of latency? The trick lies in that the storage subsystem can be smart and look at the queue and then order the I/Os in such a way that the actual access pattern to disk will be more serialised. So a disk can serve more IOPS/s at the cost of an increase in average latency. Depending on the achieved latency and the performance requirements of the application layer, this can be acceptable or not.&lt;/p&gt;
&lt;p&gt;In future blog posts I will show some performance benchmarks of a single drive to illustrate these examples.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Speeding up Linux MDADM RAID array rebuild time using bitmaps</title><link href="https://louwrentius.com/speeding-up-linux-mdadm-raid-array-rebuild-time-using-bitmaps.html" rel="alternate"/><published>2011-12-22T21:00:00+01:00</published><updated>2011-12-22T21:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-12-22:/speeding-up-linux-mdadm-raid-array-rebuild-time-using-bitmaps.html</id><summary type="html">&lt;hr&gt;
&lt;p&gt;Update 2020: Please &lt;a href="https://louwrentius.com/the-impact-of-the-mdadm-bitmap-on-raid-performance.html"&gt;beware of the impact&lt;/a&gt; of random write I/O performance. &lt;/p&gt;
&lt;p&gt;Please note that with a modern Linux distribution, bitmaps are enabled by default. They will not help speed up a rebuild after a failed drive. But it will help resync an array that got out-of-sync due to …&lt;/p&gt;</summary><content type="html">&lt;hr&gt;
&lt;p&gt;Update 2020: Please &lt;a href="https://louwrentius.com/the-impact-of-the-mdadm-bitmap-on-raid-performance.html"&gt;beware of the impact&lt;/a&gt; of random write I/O performance. &lt;/p&gt;
&lt;p&gt;Please note that with a modern Linux distribution, bitmaps are enabled by default. They will not help speed up a rebuild after a failed drive. But it will help resync an array that got out-of-sync due to power failure or another intermittent cause.&lt;/p&gt;
&lt;hr&gt;

&lt;p&gt;When a disk fails or gets kicked out of your RAID array, it often takes a lot of time to recover the array. It takes 5 hours for my own array of 20 disks to recover a single drive.&lt;/p&gt;
&lt;p&gt;Wouldn't it be nice if that time can be reduced? Even to 5 seconds? &lt;/p&gt;
&lt;p&gt;Although not enabled by default, you can enable so called 'bitmaps'. As I understand it, a bitmap is basically a map of your RAID array and it charts which areas need to be resynced if a drive fails. &lt;/p&gt;
&lt;p&gt;This is great, because I have the issues that of every 30 reboots, sometimes a disk won't get recognized and the array is degraded. Adding the disk back into the array will mean that the system will be recovering for 5+ hours. &lt;/p&gt;
&lt;p&gt;I enabled Bitmaps and after adding a missing disk back into the array, the array was recovered &lt;em&gt;instantly&lt;/em&gt;. &lt;/p&gt;
&lt;p&gt;Isn't that cool?&lt;/p&gt;
&lt;p&gt;So there are two types of bitmapsL&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;internal: part of the array itself&lt;/li&gt;
&lt;li&gt;external: a file residing on an external drive outside the array&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The internal bitmap is integrated in the array itself. Keeping the bitmap up to date will probably affect performance of the array. However I didn't notice any performance degradation.&lt;/p&gt;
&lt;p&gt;The external bitmap is a file that must reside on a EXT2 or EXT3 based file system that is not on top of the RAID array. So this means that you need an extra drive for this or need to use your boot drive for this. I can imagine that this solution will have less impact on the performance of the array but it is a bit more hassle to maintain. &lt;/p&gt;
&lt;p&gt;I enabled an internal bitmap on my RAID arrays like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mdadm --grow /dev/md5 --bitmap=internal
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is all there is to it. You can configure an external bitmap like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mdadm --grow /dev/md5 --bitmap=/some/directory/somefilename
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;There probably will be some performance penalty involved, but it does not seem to affect sequential throughput, which is the only thing that is important for my particular case.&lt;/p&gt;
&lt;p&gt;For most people, I would recommend configuring an internal bitmap, unless you really know why you would have to use an external bitmap.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Cheap solution for putting an SSD in an iMac</title><link href="https://louwrentius.com/cheap-solution-for-putting-an-ssd-in-an-imac.html" rel="alternate"/><published>2011-07-11T20:00:00+02:00</published><updated>2011-07-11T20:00:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-07-11:/cheap-solution-for-putting-an-ssd-in-an-imac.html</id><summary type="html">&lt;p&gt;If you want to order a new iMac with an SSD there are two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An SSD of 256 gigabytes will cost you a lot: 600 euros.&lt;/li&gt;
&lt;li&gt;The SSD is of medium quality, and does not justify the cost of 600 euros.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="http://forums.macrumors.com/showthread.php?t=1159154"&gt;Here&lt;/a&gt; you can find information about the Toshiba …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you want to order a new iMac with an SSD there are two problems:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An SSD of 256 gigabytes will cost you a lot: 600 euros.&lt;/li&gt;
&lt;li&gt;The SSD is of medium quality, and does not justify the cost of 600 euros.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="http://forums.macrumors.com/showthread.php?t=1159154"&gt;Here&lt;/a&gt; you can find information about the Toshiba SSD that Apple provides.&lt;/p&gt;
&lt;p&gt;You can consider buying an SSD for half the price and put it inside your new iMac yourself afterwards. However, this is a &lt;a href="http://blog.chargedpc.com/2011/05/2011-imac-ssd-install-guide.html"&gt;hassle&lt;/a&gt; and you will probably void your waranty.&lt;/p&gt;
&lt;p&gt;The solution is to buy an SSD yourself and put it in an external Firewire 800 casing. Firewire 800 provides you with about 70 megabytes per second of troughput, which is enough for most applications. It is about three times faster than USB and the latency of Firewire is lower than that of USB, thus improving responsiveness.&lt;/p&gt;
&lt;p&gt;Thunderbolt would provide the best solution, but as of July 2011, there are no Thunderbolt products on the market. &lt;/p&gt;
&lt;p&gt;The product I use is an external 2,5 inch Firewire 800 casing of OWC: the &lt;a href="http://eshop.macsales.com/item/Other%20World%20Computing/MEQM0GBK/"&gt;Mercury Elite-AL Pro mini&lt;/a&gt;.  This casing cost me about 60 euros or 80 dollars including shipping costs. I admit that this solution is not cheap, but it does work. And you won't void your warranty and it is way cheaper than the Apple SSD.&lt;/p&gt;
&lt;p&gt;&lt;img alt="OWC casing" src="http://eshop.macsales.com/imgs/ndesc/owc_mercuryalpro_mini/owc_eliteal_mini_gall1.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="OWC connectors" src="http://eshop.macsales.com/imgs/ndesc/owc_mercuryalpro_mini/owc_eliteal_mini_gall3.jpg" /&gt; &lt;/p&gt;
&lt;p&gt;I've put my Intel SSD inside this casing and my mac boots in about 15 seconds. After entering username and password, login is almost instantaneously. &lt;/p&gt;
&lt;h3&gt;Caveat&lt;/h3&gt;
&lt;p&gt;I encountered one problem with the OWC casing. I encountered random system freezes, related to the external OWC housing. Using the internal 1 TB hard drive, I had no problems. The cause of this issue is probably related to power not being provided to the OCW casing after the systems returns from sleep. &lt;/p&gt;
&lt;p&gt;I resolved this issue by connecting a special USB cable to the iMac and connecting the other end to the 5V DC Power Input on the OWC casing. After that, the daily random system freezes vanished. These cables can be obtained almost everywhere.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Thunderbolt, a cheap high-speed storage interconnect?</title><link href="https://louwrentius.com/thunderbolt-a-cheap-high-speed-storage-interconnect.html" rel="alternate"/><published>2011-02-25T21:30:00+01:00</published><updated>2011-02-25T21:30:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2011-02-25:/thunderbolt-a-cheap-high-speed-storage-interconnect.html</id><summary type="html">&lt;p&gt;Intel and Apple released &lt;a href="http://www.macworld.com/article/158145/2011/02/thunderbolt_what_you_need_to_know.html"&gt;Thunderbolt&lt;/a&gt; a high-speed (10 Gigabit/s) interface, that seems to replace both USB and Firewire. It is mainly targeted at end-user systems allowing to connect peripherals with just a single cable to a computer. Thunderbolt devices, like external hard drives or displays can be daisy chained …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Intel and Apple released &lt;a href="http://www.macworld.com/article/158145/2011/02/thunderbolt_what_you_need_to_know.html"&gt;Thunderbolt&lt;/a&gt; a high-speed (10 Gigabit/s) interface, that seems to replace both USB and Firewire. It is mainly targeted at end-user systems allowing to connect peripherals with just a single cable to a computer. Thunderbolt devices, like external hard drives or displays can be daisy chained, like Firewire. In short, Thunderbolt removes the cable clutter and ads a significant speed bonus.  &lt;/p&gt;
&lt;p&gt;For NAS owners and storage enthusiasts, this is also a very interesting technology. Just like Firewire, it seems to support computer-to-computer communication. So Thunderbolt could be used as a high-speed link between your homegrown NAS device and your PC workstation. Or between two storage / server system. &lt;/p&gt;
&lt;p&gt;&lt;img alt="Thunderbolt" src="/static/images/thunderbolt01.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The only downside to Thunderbolt is the maximum cable length of 3 meters between devices. Thunderbolt doesn't seem to be the ideal replacement for your Gigabit network, but if most of your computer systems are close to each other, it might be very interesting.&lt;/p&gt;</content><category term="Storage"/></entry><entry><title>Do not buy a hardware RAID controller for home use</title><link href="https://louwrentius.com/do-not-buy-a-hardware-raid-controller-for-home-use.html" rel="alternate"/><published>2010-11-17T21:00:00+01:00</published><updated>2010-11-17T21:00:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2010-11-17:/do-not-buy-a-hardware-raid-controller-for-home-use.html</id><summary type="html">&lt;p&gt;Hardware RAID controllers are considered 'the best' solution for high
performance and high availability. However, this is not entirely true. Using a
hardware RAID controller might even endanger your precious data.&lt;/p&gt;
&lt;p&gt;For enterprise environments, where performance is critical, it is more
important that the arrays keeps on delivering data at …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hardware RAID controllers are considered 'the best' solution for high
performance and high availability. However, this is not entirely true. Using a
hardware RAID controller might even endanger your precious data.&lt;/p&gt;
&lt;p&gt;For enterprise environments, where performance is critical, it is more
important that the arrays keeps on delivering data at a high speed.
Professional RAID controllers use &lt;a href="http://en.wikipedia.org/wiki/Time-Limited_Error_Recovery"&gt;TLER&lt;/a&gt; with TLER-enabled disks to limit
the time spend on recovering bad sectors. If a disk encounters a bad sector,
there is no time to pause and try to fix it. The disk is just dropped out of
the RAID array after just a couple of seconds. At that moment, the array still
performes relatively well, but there is no redundancy. If another disk fails
(another bad sector?) the array is lost, with all its data.&lt;/p&gt;
&lt;p&gt;More people are building NAS boxes for centralized storage of data, for
private home use. Since disks are cheap, it is possible to create lots of
storage capacity for little money. Creating backups of terabytes of data is
however not cheap. Or you have to create two NAS boxes. But that is very
expensive and not worth the effort.&lt;/p&gt;
&lt;p&gt;People seem to spend lots of money on expensive enterprise level hardware RAID
cards, not understanding that the whole TLER-mechanism causes an increased
risk for their data. In enterprise environments, budgets are relatively big,
and data is always backed up. They can afford to take the risk of losing a
RAID array due to these backups. But consumers often don't have the money to
spend on creating backups of terabytes of data. They just go for RAID 5 or
RAID 6 and hope for the best.&lt;/p&gt;
&lt;p&gt;For consumers, if the RAID array goes, all data is lost.&lt;/p&gt;
&lt;p&gt;So consumers should choose a RAID solution that will do its best to recover
from hardware failure. Performance is not so much an issue. Reliability is. So
consumers do want disks to spend 'ages' on recovering bad sectors if this
means that the RAID array will survive.&lt;/p&gt;
&lt;p&gt;Linux software RAID and ZFS do not use TLER and therefore are a safer choice
for your data then regular hardware RAID controllers. You may still use such
controllers (but please test them properly) but only to provide SATA ports
with individual disks, the RAID part should be handled by Linux.&lt;/p&gt;
&lt;p&gt;So in my opinion, hardware RAID controllers are more expensive, require more
expensive (enterprise) disks and are less safe for your data.&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>Linux Software RAID benchmarking script</title><link href="https://louwrentius.com/linux-software-raid-benchmarking-script.html" rel="alternate"/><published>2010-09-29T20:58:00+02:00</published><updated>2010-09-29T20:58:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2010-09-29:/linux-software-raid-benchmarking-script.html</id><summary type="html">&lt;p&gt;Just a small post.&lt;/p&gt;
&lt;p&gt;To benchmark your Linux software RAID array as setup with MDADM, please use my
&lt;a href="/files/raid-tester.sh"&gt;new benchmark script&lt;/a&gt;. I used this script to create &lt;a href="https://louwrentius.com/blog/2010/05/linux-raid-level-and-chunk-size-the-benchmarks/"&gt;these results&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You may need to configure some values within the header of this file to make
it fit your enviroment.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DEVICES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/dev …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Just a small post.&lt;/p&gt;
&lt;p&gt;To benchmark your Linux software RAID array as setup with MDADM, please use my
&lt;a href="/files/raid-tester.sh"&gt;new benchmark script&lt;/a&gt;. I used this script to create &lt;a href="https://louwrentius.com/blog/2010/05/linux-raid-level-and-chunk-size-the-benchmarks/"&gt;these results&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You may need to configure some values within the header of this file to make
it fit your enviroment.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;DEVICES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/dev/sd[a-f]&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NO_OF_DEVICES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ARRAY&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;md5&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;CHUNKS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;4 8 16 32 64 128 256 512 1024&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MOUNT&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="n"&gt;storage&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LOG&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;raid&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LOGDEBUG&lt;/span&gt;&lt;span class="o"&gt;=/&lt;/span&gt;&lt;span class="k"&gt;var&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;raid&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;debug&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;log&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;LEVEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;0 5 6 10&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TESTFILE&lt;/span&gt;&lt;span class="o"&gt;=$&lt;/span&gt;&lt;span class="n"&gt;MOUNT&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bin&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TESTFILESIZE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;thus&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;GB&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TRIES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;how&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;many&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;times&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;benchmark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;By default, the script wil format the array using XFS, feel free to format
it with another filesystem such as EXT4 or EXT3 or whatever you want to test.&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>RAID 5 vs. RAID 6 or do you care about your data?</title><link href="https://louwrentius.com/raid-5-vs-raid-6-or-do-you-care-about-your-data.html" rel="alternate"/><published>2010-08-13T15:06:00+02:00</published><updated>2010-08-13T15:06:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2010-08-13:/raid-5-vs-raid-6-or-do-you-care-about-your-data.html</id><summary type="html">&lt;p&gt;Storage is cheap. Lots of storage with 10+ hard drives is still cheap. Running
10 drives increases the risk of a drive failure tenfold. So often RAID 5 is
used to keep your data up and running if one single disks fails.&lt;/p&gt;
&lt;p&gt;But disks are so cheap and storage arrays …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Storage is cheap. Lots of storage with 10+ hard drives is still cheap. Running
10 drives increases the risk of a drive failure tenfold. So often RAID 5 is
used to keep your data up and running if one single disks fails.&lt;/p&gt;
&lt;p&gt;But disks are so cheap and storage arrays are getting so vast that RAID 5 does
not cut it anymore. With larger arrays, the risk of a second drive failure
while your failed array is in a degraded state (a drive already failed and the
array is rebuilding or waiting for a replacement), is serious.&lt;/p&gt;
&lt;p&gt;RAID 6 uses two parity disks, so you loose two disks of capacity, but the
rewards in terms of availability are very large. Especially regarding larger
arrays.&lt;/p&gt;
&lt;p&gt;I found &lt;a href="http://blog.kj.stillabower.net/?p=93"&gt;a blog posting&lt;/a&gt; that showed the results on a big simulation run on
the reliability of various RAID setups. One picture of this post is important
and it is shown below. This picture shows the risk of the entire RAID array
failing before 3 years.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.kj.stillabower.net/wp-content/uploads/2009/08/3fail.png"&gt;&lt;img alt="image" src="http://blog.kj.stillabower.net/wp-content/uploads/2009/08/3fail.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;From this picture, the difference between RAID 5 and RAID 6 regarding
reliability (availability) is astounding. There is a strong relation with the
size of the array (number of drives) and the increased risk that more than one
drive fails, thus destroying the array. Notice the strong contrast with RAID
6.&lt;/p&gt;
&lt;p&gt;Even with a small RAID 5 array of 6 disks, there is already a 1 : 10 chance
that the array will fail within 3 years. Even with 60+ drives, a RAID 6 array
never comes close to a risk like that.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Creating larger RAID 5 arrays beyond 8 to 10 disks means there is a 1 : 8 to 1&lt;/dt&gt;
&lt;dd&gt;5 chance that you will have to recreate the array and restore the contents
from backup (which you have of course).&lt;/dd&gt;
&lt;/dl&gt;
&lt;p&gt;I have a 20 disk RAID 6 running at home. Even with 20 disks, the risk that the
entire array fails due to failure of more than 2 disks is very small. It is
more likely that I lose my data due to failure of a RAID controller,
motherboard or PSU than dying drives.&lt;/p&gt;
&lt;p&gt;There are more graphs that are worth viewing, so &lt;a href="http://blog.kj.stillabower.net/?p=93"&gt;take a look at this excelent
blog post.&lt;/a&gt;&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>Lustre and the risk of Serious Data Loss</title><link href="https://louwrentius.com/lustre-and-the-risk-of-serious-data-loss.html" rel="alternate"/><published>2010-07-03T22:53:00+02:00</published><updated>2010-07-03T22:53:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2010-07-03:/lustre-and-the-risk-of-serious-data-loss.html</id><summary type="html">&lt;p&gt;Personally I have a weakness for big-ass storage. Say 'petabyte' and I'm
interested. So I was thinking about how you would setup a large, scalable
storage infrastructure. How should such a thing work?&lt;/p&gt;
&lt;p&gt;Very simple: you should be able just to add hosts with some bad-ass huge RAID
arrays attached …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Personally I have a weakness for big-ass storage. Say 'petabyte' and I'm
interested. So I was thinking about how you would setup a large, scalable
storage infrastructure. How should such a thing work?&lt;/p&gt;
&lt;p&gt;Very simple: you should be able just to add hosts with some bad-ass huge RAID
arrays attached to them. Maybe even not that huge, say 8 TB RAID 6 arrays or
maybe bigger. You use these systems as building blocks to create a single and
very large storage space. And then there is one additional requirement: as the
number of these building blocks increase, you must be able to loose some and
not loose data or availability. You should be able to continue operations
without one or two of those storage building blocks before you would loose
data and/or availability. Like RAID 5 or 6 but then over server systems
instead of hard drives.&lt;/p&gt;
&lt;p&gt;The hard part is in connecting all this separate storage to one virtual
environment. A solution to this problem is Lustre.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://wiki.lustre.org/index.php/Main_Page"&gt;Lustre&lt;/a&gt; is a network clustering filesystem. What does that mean? You can
use Lustre to create a scalable storage platform. A single filesystem that can
grow to multiple Petabytes. Lustre is deployed within production environments
at large scale sites involving some of the fastest and largest computer
clusters. Luster is thus something to take seriously.&lt;/p&gt;
&lt;p&gt;Lustre stores all metadata about files on a separate MetaDataServer (MDS). Al
actual file data is stored on Object Storage Targets (OSTs). These are just
machines with one or more big RAID arrays (or simple disks) attached to them.
The OSTs are not directly accessible by clients, but through an Object Storage
Server (OSS). The data stored within a file can be striped over multiple OSTs
for performance reasons.  A sort of network RAID 0.&lt;/p&gt;
&lt;p&gt;Lustre does not only allow scaling up to Petabytes of storage, but allows also
a parallel file transfer performance in excess of 100 GB/s. How you like them
apples? That is just wicked sick.&lt;/p&gt;
&lt;p&gt;Just take a look at this diagram about how Lustre operates:&lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/lustre-schema.jpg"&gt;&lt;img alt="lustre schema" src="/static/images/lustre-schema-small.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'm not going into the details about Lustre. I want to discuss a shortcoming
that may pose a serious risk of data loss: &lt;strong&gt;&lt;em&gt;if you loose a single OST with
any attached storage, you will lose all data stored on that OST&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Lustre cannot cope with the loss of a single OST! Even if you buy fully
redundant hardware, with double RAID controllers, ECC memory, double PSU, etc,
even then, if the motherboard gets fried, you will loose data. Surely not
everything, but let's say 'just' 8 TB maybe?&lt;/p&gt;
&lt;p&gt;I guess the risk is assumed to be low, because of the wide scale deployment of
Lustre. Deployed by people who actually use it and have way more experience
and knowledge than me about this whole stuff. So maybe I'm pointing out risks
that are just very small. But I have seen server systems fail this bad as
described. I don't think the risk, especially at this scale, is not that
small.&lt;/p&gt;
&lt;p&gt;I am certainly &lt;a href="http://www.mail-archive.com/lustre-discuss@clusterfs.com/msg01048.html"&gt;not the first&lt;/a&gt; to &lt;a href="http://comments.gmane.org/gmane.comp.file-systems.lustre.user/9501"&gt;point out this risk&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The solution for Lustre to became truly awesome is to implement some kind of
network based RAID 6 striping so you could loose one or even two OSTs and not
have any impact on availability except maybe for performance. But it doesn't
(yet).&lt;/p&gt;
&lt;p&gt;This implies that you have to create your OSTs super-reliable, which would be
very expensive (does not scale). Or have some very high-capacity backup
solution, which would be able to restore some data. But you would have
downtime.&lt;/p&gt;
&lt;p&gt;So my question to you is: is there an actual scalable filesystem as Lustre
that actually is capable of withstanding the failure of a single storage
building block? If you have something to point out, please do.&lt;/p&gt;
&lt;p&gt;BTW: please note that the loss of an OSS can be overcome because another OSS
can take over the OSTs of a failed OSS.&lt;/p&gt;</content><category term="Storage"/><category term="lustre"/><category term="ost"/><category term="failure"/><category term="data"/><category term="loss"/></entry><entry><title>'Linux RAID level and chunk size: the benchmarks'</title><link href="https://louwrentius.com/linux-raid-level-and-chunk-size-the-benchmarks.html" rel="alternate"/><published>2010-05-23T19:11:00+02:00</published><updated>2010-05-23T19:11:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2010-05-23:/linux-raid-level-and-chunk-size-the-benchmarks.html</id><summary type="html">&lt;p&gt;Introduction&lt;/p&gt;
&lt;p&gt;When configuring a Linux RAID array, the chunk size needs to get chosen. But
what is the chunk size?&lt;/p&gt;
&lt;p&gt;When you write data to a RAID array that implements striping (level 0, 5, 6,
10 and so on), the chunk of data sent to the array is broken down …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Introduction&lt;/p&gt;
&lt;p&gt;When configuring a Linux RAID array, the chunk size needs to get chosen. But
what is the chunk size?&lt;/p&gt;
&lt;p&gt;When you write data to a RAID array that implements striping (level 0, 5, 6,
10 and so on), the chunk of data sent to the array is broken down in to
pieces, each part written to a single drive in the array. This is how striping
improves performance. The data is written in parallel to the drive.&lt;/p&gt;
&lt;p&gt;The chunk size determines how large such a piece will be for a single drive.
For example: if you choose a chunk size of 64 KB, a 256 KB file will use four
chunks. Assuming that you have setup a 4 drive RAID 0 array, the four chunks
are each written to a separate drive, exactly what we want.&lt;/p&gt;
&lt;p&gt;This also makes clear that when choosing the wrong chunk size, performance may
suffer. If the chunk size would be 256 KB, the file would be written to a
single drive, thus the RAID striping wouldn't provide any benefit, unless
manny of such files would be written to the array, in which case the different
drives would handle different files.&lt;/p&gt;
&lt;p&gt;In this article, I will provide some benchmarks that focus on sequential read
and write performance. Thus, these benchmarks won't be of much importance if
the array must sustain a random IO workload and needs high random iops.&lt;/p&gt;
&lt;h3&gt;Test setup&lt;/h3&gt;
&lt;p&gt;All benchmarks are performed with a consumer grade system consisting of these
parts:&lt;/p&gt;
&lt;p&gt;Processor: AMD Athlon X2 BE-2300, running at 1.9 GHz.&lt;/p&gt;
&lt;p&gt;RAM: 2 GB&lt;/p&gt;
&lt;p&gt;Disks: SAMSUNG HD501LJ (500GB, 7200 RPM)&lt;/p&gt;
&lt;p&gt;SATA controller: Highpoint RocketRaid 2320 (non-raid mode)&lt;/p&gt;
&lt;p&gt;Tests are performed with an array of 4 and an array of 6 drives.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;All drives are attached to the Highpoint controller. The controller is not
used for RAID, only to supply sufficient SATA ports. Linux software RAID with
mdadm is used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A single drive provides a read speed of 85 MB/s and a write speed of 88
MB/s&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The RAID levels 0, 5, 6 and 10 are tested.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Chunk sizes starting from 4K to 1024K are tested.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;XFS is used as the test file system.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data is read from/written to a 10 GB file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The theoretical max through put of a 4 drive array is 340 MB/s. A 6 drive
array should be able to sustain 510 MB/s.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;About the data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;All tests have been performed by a Bash shell script that accumulated all
data, there was no human intervention when acquiring data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;All values are based on the average of five runs. After each run, the RAID
array is destroyed, re-created and formatted.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;For every RAID level + chunk size, five tests are performed and averaged.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data transfer speed is measured using the 'dd' utility with the option
bs=1M.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Test results&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;Results of the tests performed with four drives:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/4drives.png"&gt;&lt;img alt="image" src="/static/images/4drives.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Test results with six drives:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/6drives.png"&gt;&lt;img alt="image" src="/static/images/6drives.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Analysis and conclusion&lt;/h3&gt;
&lt;p&gt;Based on the test results, several observations can be made. The first one is
that RAID levels with parity, such as RAID 5 and 6, seem to favor a smaller
chunk size of 64 KB.&lt;/p&gt;
&lt;p&gt;The RAID levels that only perform striping, such as RAID 0 and 10, prefer a
larger chunk size, with an optimum of 256 KB or even 512 KB.&lt;/p&gt;
&lt;p&gt;It is also noteworthy that RAID 5 and RAID 6 performance don't differ that
much.&lt;/p&gt;
&lt;p&gt;Furthermore, the theoretical transfer rates that should be achieved based on
the performance of a single drive, are not met. The cause is unknown to me,
but overhead and the relatively weak CPU may have a part in this. Also, the
XFS file system may play a role in this. Overall, it seems that on this
system, software RAID does not seem to scale well. Since my big storage
monster (as seen on the left) is able to perform way better, I suspect that it
is a hardware issue.&lt;/p&gt;
&lt;p&gt;because the M2A-VM consumer-grade motherboard can't go any faster.&lt;/p&gt;</content><category term="Storage"/><category term="linux"/><category term="mdadm"/><category term="raid"/><category term="chunk"/><category term="size"/><category term="benchmark"/><category term="performance"/></entry><entry><title>20 disk 18 TB RAID 6 storage based on Debian Linux</title><link href="https://louwrentius.com/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html" rel="alternate"/><published>2009-07-21T21:08:00+02:00</published><updated>2009-07-21T21:08:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-07-21:/20-disk-18-tb-raid-6-storage-based-on-debian-linux.html</id><summary type="html">&lt;h3&gt;This system is no longer operational and has been decomissioned (2017)&lt;/h3&gt;
&lt;p&gt;This is my NAS storage server based on Debian Linux. It uses software RAID and 20 one
terrabyte hard drives. It provides a total usable storage capacity of 18 terrabytes in a single RAID 6 array.&lt;/p&gt;
&lt;p&gt;One of the …&lt;/p&gt;</summary><content type="html">&lt;h3&gt;This system is no longer operational and has been decomissioned (2017)&lt;/h3&gt;
&lt;p&gt;This is my NAS storage server based on Debian Linux. It uses software RAID and 20 one
terrabyte hard drives. It provides a total usable storage capacity of 18 terrabytes in a single RAID 6 array.&lt;/p&gt;
&lt;p&gt;One of the remarkable side effects of using 20 drives within a single array is the read performance of over one gigabyte per second. &lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/norco05.jpg"&gt;&lt;img alt="norco nas" src="/static/images/norco05.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;table border="0" cellpadding="0" cellspacing="1" &gt;
&lt;tr&gt;&lt;td&gt;Case:&lt;/td&gt;&lt;td &gt;Norco RPC-4020&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Processor:&lt;/td&gt;&lt;td &gt;Core 2 duo E7400 @ 2.8GHz&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;RAM:&lt;/td&gt;&lt;td &gt;4 GB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Motherboard:&lt;/td&gt;&lt;td &gt; Asus P5Q-EM DO&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;LAN:&lt;/td&gt;&lt;td &gt;Intel Gigabit&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;PSU:&lt;/td&gt;&lt;td &gt;&lt;s&gt;Coolermaster 600 Watt&lt;/s&gt; Corsair CMPSU-750HX 750 Watt (Coolermaster died)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Controller: &lt;/td&gt;&lt;td &gt;HighPoint RocketRAID 2340 (16) and on-board controller (6).&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Disks:&lt;/td&gt;&lt;td &gt;20 x Samsung Spinpoint F1 (1 TB) and 2 x FUJITSU MHY2060BH (60 GB)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Arrays:&lt;/td&gt;&lt;td &gt;Boot: 2x 60 GB RAID 1 and storage: 20 x 1 TB RAID 6&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;RAID setup:&lt;/td&gt;&lt;td &gt;Linux software RAID using MDADM.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;RAM:&lt;/td&gt;&lt;td &gt;4 GB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Read performance:&lt;/td&gt;&lt;td &gt;1.1 GB/s (yes this is correct, not a typo)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Write performance:&lt;/td&gt;&lt;td &gt;&lt;s&gt;350&lt;/s&gt; 450 MB/s. (suddenly faster after Debian update)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;OS:&lt;/td&gt;&lt;td &gt;Linux Debian Squeeze 64-bit&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Filesystem:&lt;/td&gt;&lt;td &gt;XFS (can handle &amp;gt; 16 TB partitions.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Rebuild time:&lt;/td&gt;&lt;td &gt;about 5 hours.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;UPS:&lt;/td&gt;&lt;td &gt;Back-UPS RS 1200 LCD using Apcupsd&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Idle power usage:&lt;/td&gt;&lt;td &gt;about &amp;nbsp;140 Watt&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;&lt;a href="/static/images/norco04.jpg"&gt;&lt;img alt="norco nas" src="/static/images/norco04.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/lactower.jpg"&gt;&lt;img alt="setup" src="/static/images/lactower.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;object height="340" width="560"&gt;&lt;param name="movie" value="http://www.youtube.com/v/EGLaFiXHegw&amp;amp;hl=nl_NL&amp;amp;fs=1&amp;amp;"&gt;
&lt;param name="allowFullScreen" value="true"&gt;
&lt;param name="allowscriptaccess" value="always"&gt;
&lt;embed src="http://www.youtube.com/v/EGLaFiXHegw&amp;amp;hl=nl_NL&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"&gt;&lt;/embed&gt;&lt;/object&gt;</content><category term="Storage"/><category term="norco"/><category term="RPC-4020"/><category term="Linux"/><category term="RAID"/><category term="6"/><category term="MDADM"/><category term="20"/><category term="disk"/><category term="18"/><category term="TB"/></entry><entry><title>Script that shows ETA of RAID rebuild / reshape</title><link href="https://louwrentius.com/script-that-shows-eta-of-raid-rebuild-reshape.html" rel="alternate"/><published>2009-06-28T22:43:00+02:00</published><updated>2009-06-28T22:43:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2009-06-28:/script-that-shows-eta-of-raid-rebuild-reshape.html</id><summary type="html">&lt;p&gt;I made a small script that converts the output of &lt;code&gt;cat /proc/mdstat&lt;/code&gt; to an
actual date and time telling you when the RAID rebuild / reshape is finished.&lt;/p&gt;
&lt;p&gt;&lt;a href="/files/raid-rebuild-eta.tgz"&gt;This is the link to the correct version of the script.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;debian:~# ./raid-rebuild-eta.sh

Estimated time of finishing rebuild / reshape:
Mon …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I made a small script that converts the output of &lt;code&gt;cat /proc/mdstat&lt;/code&gt; to an
actual date and time telling you when the RAID rebuild / reshape is finished.&lt;/p&gt;
&lt;p&gt;&lt;a href="/files/raid-rebuild-eta.tgz"&gt;This is the link to the correct version of the script.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;debian:~# ./raid-rebuild-eta.sh

Estimated time of finishing rebuild / reshape:
Mon Jun 29 00:45:07 CEST 2009
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>Calculating EXT2 EXT3 EXT4 stride size when using RAID</title><link href="https://louwrentius.com/calculating-ext2-ext3-ext4-stride-size-when-using-raid.html" rel="alternate"/><published>2008-12-20T22:15:00+01:00</published><updated>2008-12-20T22:15:00+01:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2008-12-20:/calculating-ext2-ext3-ext4-stride-size-when-using-raid.html</id><summary type="html">&lt;p&gt;When formatting a RAID device with an EXT filesystem, it is always advised to
specify a stride size. The format utility will take this stride size into
account when formatting a device. The stride size is the number you get when
you divide the 'chunck' size, as specified with MDADM …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When formatting a RAID device with an EXT filesystem, it is always advised to
specify a stride size. The format utility will take this stride size into
account when formatting a device. The stride size is the number you get when
you divide the 'chunck' size, as specified with MDADM by the filesystem block
size (almost always 4K).&lt;/p&gt;
&lt;p&gt;So a 128 KB chunck size gives you a stride of 32. A nice and simple utility to
calculate your stride can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://busybox.net/~aldot/mkfs_stride.html"&gt;http://busybox.net/~aldot/mkfs_stride.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please note that the stripe-with option does not seem to work on Debian Etch.
Maybe because that option is too old or too new.&lt;/p&gt;
&lt;p&gt;I also think that most recent tools automatically detect and calculate the correct 
stride size for you.&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>Is storage really that cheap?</title><link href="https://louwrentius.com/is-storage-really-that-cheap.html" rel="alternate"/><published>2008-10-05T21:47:00+02:00</published><updated>2008-10-05T21:47:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2008-10-05:/is-storage-really-that-cheap.html</id><summary type="html">&lt;p&gt;Nowadays you can buy a 1 TB harddrive for less than 100 euro's . So I build
myself a 4 TB NAS box, which is already 50% full. However, although it is to
some degree fault-tollerant by using RAID 6, one mistake or catastrophic
hardware faillure and all data is lost …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Nowadays you can buy a 1 TB harddrive for less than 100 euro's . So I build
myself a 4 TB NAS box, which is already 50% full. However, although it is to
some degree fault-tollerant by using RAID 6, one mistake or catastrophic
hardware faillure and all data is lost.&lt;/p&gt;
&lt;p&gt;And that's where the 'problem' start. For every € spend on storage, you may
need another € to secure that storage.&lt;/p&gt;
&lt;p&gt;You can choose to take and accept the risk outlined earlier and not to make
backups. However, if you do want to make backups of terrabytes of storage, how
are you going to pull that off without too much cost? &lt;/p&gt;
&lt;p&gt;In my opinion, the only reliable and usable solution is to build a second NAS
box and sync the two. Ideally, both machines reside at different locations, but
hey, I'm talking about a home solution, not a professional environment.
Although you might ask why on earth you need 4 TB of space at home in the first place.&lt;/p&gt;
&lt;p&gt;Anyway, the point I'm trying to make is that although storage in itself is
cheap, if you want to keep all that data safe, storage is far more expensive than 
you might think.&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry><entry><title>Building a RAID 6 array of mixed drives</title><link href="https://louwrentius.com/building-a-raid-6-array-of-mixed-drives.html" rel="alternate"/><published>2008-08-10T11:36:00+02:00</published><updated>2008-08-10T11:36:00+02:00</updated><author><name>Louwrentius</name></author><id>tag:louwrentius.com,2008-08-10:/building-a-raid-6-array-of-mixed-drives.html</id><summary type="html">&lt;p&gt;To be honest, 4 TB of storage isn't really necessary for home usage.
However, I like to collect movies in full DVD or HD quality and so I need some
storage.&lt;/p&gt;
&lt;p&gt;I decided to build myself a NAS box based on Debian Etch. Samba is used to
allow clients to …&lt;/p&gt;</summary><content type="html">&lt;p&gt;To be honest, 4 TB of storage isn't really necessary for home usage.
However, I like to collect movies in full DVD or HD quality and so I need some
storage.&lt;/p&gt;
&lt;p&gt;I decided to build myself a NAS box based on Debian Etch. Samba is used to
allow clients to access the data. The machine itself was initially based on 4
x 0.5 TB disks using the four SATA ports on the mainboard. With Linux build-in
support for software RAID, I created a RAID 5 array, giving me 1.5 TB of
storage space. Since a single movie is around 4 GB, the 1.5 TB turned out to
become rather tight.&lt;/p&gt;
&lt;p&gt;So I bought 4 x 1 TB disks and a Highpoint RocketRaid 2320 controller (SATA
4x). I put all 8 disks on this controller.&lt;/p&gt;
&lt;p&gt;I wanted to create a single RAID 6 array using both the 1 TB disks and the 0.5
TB disks. I didn't want to create two separate array's because although it
would have provided additional space, it wouldn't have given me the same
safety level as RAID 6 does.&lt;/p&gt;
&lt;p&gt;I mainly chose for RAID 6 since I cannot afford a backup solution  for this
amount of data. I'm aware that RAID is no substitute for a proper backup, but
it's an accepted risk for me.&lt;/p&gt;
&lt;p&gt;Using both 1 TB disks and 0.5 TB disks, how to create a RAID 6 array using
different drive sizes? The solution is fairly simple. Just put two 0.5 TB
disks together in one RAID 0 volume and you'll have a 'virtual' 1 TB disk.
Since I had four 0.5 TB disks, I could create 2 'virtual' 1 TB disks. &lt;/p&gt;
&lt;p&gt;&lt;a href="/static/images/raid6scheme.png"&gt;&lt;img alt="raidscheme" src="/static/images/raid6scheme-small.png" /&gt;&lt;/a&gt;The only downside is that I had to skim a little bit of storage
capacity of the native 1 TB drives, because 2 x 0.5 TB provides slightly less
storage space than a single 1 TB disk. We're talking about something like 50
MB here, so It's not a big deal in my opinion. &lt;/p&gt;
&lt;p&gt;The funny thing is that this array actually performs rather well. The disks
are connected using a HighPoint RocketRaid 2320 controller. This controller is
used just for it's SATA-ports, the on-board RAID functionality is not used.
For RAID, I use Linux software RAID, using mdadm. This is how the RAID 6 array
looks like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;        server:~# mdadm --detail /dev/md5
        /dev/md5:
        Version : 00.90.03
  Creation Time : Thu Jul 24 22:40:26 2008
     Raid Level : raid6
     Array Size : 3906359808 (3725.40 GiB 4000.11 GB)
    Device Size : 976589952 (931.35 GiB 1000.03 GB)
   Raid Devices : 6
  Total Devices : 6
Preferred Minor : 5
    Persistence : Superblock is persistent
    Update Time : Sun Aug 10 15:36:18 2008
          State : clean
 Active Devices : 6
Working Devices : 6
 Failed Devices : 0
  Spare Devices : 0
     Chunk Size : 128K
           UUID : 0442e8fa:acd9278e:01f9e43d:ac30fbff (local to host server)
         Events : 0.14170

Number   Major   Minor   RaidDevice State
   0       8        1        0      active sync   /dev/sda1
   1       8       17        1      active sync   /dev/sdb1
   2       8       33        2      active sync   /dev/sdc1
   3       8       49        3      active sync   /dev/sdd1
   4       9        0        4      active sync   /dev/md0
   5       9        1        5      active sync   /dev/md1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And this is how this array performs:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;server:~# dd if=/storage/test.bin of=/dev/null bs=1M

10000+0 records in
10000+0 records out
10485760000 bytes (10 GB) copied, 45.7107 seconds, 229 MB/s

server:~# dd if=/dev/zero of=/storage/test.bin bs=1M count=10000

10000+0 records in
10000+0 records out
10485760000 bytes (10 GB) copied, 81.0798 seconds, 129 MB/s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;With 229 MB/s read performance and 129 MB/s write performance using RAID 6, I
think I should be content.&lt;/p&gt;</content><category term="Storage"/><category term="Uncategorized"/></entry></feed>