352 points · by MBCook · 8y ago · 146 comments
One day while working on things I noticed a message on our server indicating a PDR1001 Error (Predictive Failure). So we ordered a new one. The new SSD arrived. We popped in the new one and the RAID started to rebuild.... Lo and behold during that operation Drive 1 threw the same error and the whole thing came crashing down...
We ended up losing the whole array. I had NO idea we had SSD's in the system. I had no idea that no one was monitoring their life.... The moment I saw we had this issue I saw the writing on the wall. 4 SSD's in a raid 5 all installed at the same time... means all SSDs end up with the same approximate critical end of life.
All I could do was shake my head at the whole thing... Pretty sure those in the charge who setup the array still don't understand why this situation was 100% avoidable...
RAID5 definitely has a purpose, notable small arrays where RAID6 would be wasting space or if you have nodes to failover too (ie, you have 3 nodes, run each with raid 5, if one goes belly up during a rebuild you still have 2 left and you can reprovision the third).
RAID6 would likely be at the limit of most modern implementations so you'd have to jump to (n,n-3) RAIDs or higher. Of course there is always RAID1(0) if you like 50% storage efficiency.
This doesn't quite make sense to me. Why would the size of the array make any difference as to whether or not the extra drives needed by RAID6 can be characterized as waste?
> or if you have nodes to failover too
In essence, that's RAID5+1, which makes me wonder: If you have node-level redundancy, why bother with the intra-node redundancy?
> RAID6 would likely be at the limit of most modern implementations so you'd have to jump to (n,n-3) RAIDs or higher.
It's not clear to me what limit you're referring to, but, considering how long RAID6 has been implemented, especially in hardware, and how far computing power has increased since then, such a claim is dubious, if not extraordinary.
I thought zfs was not incompatible with RAID. How else would you run it out of curiosity?
Disks are large and cheap enough to afford losing 50% of your capacity, and it's much faster while in use and when rebuilding.
Other examples are ZFS's RAID-Z, which can support even more parity for even more resiliency to drive failure.
Contrary to a sibling comment, RAID1+0 does not supersede RAID5, as it has existed at least as long and has always had different trade-offs.
How many drive failures one may need to be able to survive, given historical drive failure rates [1], current drive capacity vs. transfer rates (i.e. minimum rebuild time), and individual parameters (e.g. number of drives per array, acceptable magnitude of performance degradation during rebuild), is left as an exercise to the reader.
As the OC suggested, this number can still be 1 (i.e. RAID5) for SSDs.
[1] optionally including or excluding "black swan" events such as the flooding in Thailand that wiped out thos disk factories, rendering an entire "generation" of HDDs, manufactured in haste elsewhere, far less reliable
Care to elaborate on this? Disk specs? Resilivering time?
RAID 1 naturally spreads writes across all disks. RAID 5 is designed to spread writes evenly across all disks. Sure, certain applications will do uneven writing, but in general it will be fairly even and this is by design. RAID 3 and RAID 4 were abandoned partially because they used dedicated parity drives, and the result was that the parity drives had much higher write loads and so they failed all the time. This meant that the arrays were more often rebuilding or running with degraded protection.
For the few of us left who know how to do this (or even that it's beneficial to do in the first place), it's becoming less practical to do at scale.
It's hard enough finding someone who will hire me and use any of These Thngs I Know about operating hardware, isntead of just my "automation" skills, as if all problems can be solved in software.
But in addition to this, standard Raid5 does not periodically read the data, so it's actually rather common for issues to only arise on a resilver.
This is why proper maintenance in ZFS is to run ZFS Scrub (basically check every file) once a week.
I'm not sure if you meant to imply that ZFS is different from standard RAID in this regard, but it doesn't seem as though it is.
AND b) raid rebuild causes MASSIVE stress on the remaining drives. Seriously massive stress, beyond what distributed systems or raid 1 / 6 based systems do.
This occurs because RAID5 both rewrites parities, but it also has to re-read data from all drives while writing parities to all drives. That's a lot of random access and especially spin-drives and larger drives (see the coincidence?) dislike that. That tends to cause similar-aged drives to die and then your raid is gone.
I'd suppose this is less hard on SSDs than HDDs. But there's still a lot of rewrites going on, and SSDs don't like that either.
b) What makes you think RAID6 doesn't also incur this? The only difference is that RAID6 also includes a Q parity block in each stripe, so the only thing you get saved from is if you don't need to read the parity on the stripes, you save 1/(N+P-1) IOs per drive.
RAID6 is still going to need to recompute ~2/(N+P) parities (one P, and one Q) for rebuilding a drive over (N+P) stripes; and reconstruct the data for the rest (depending on how P and Q are implemented, they could interweave which they use for reconstructions, but AIUI it's generally more expensive to recompute from Q than P, and R than P or Q, in many instances of this math).
c) Many RAID systems can rebuild starting from the starts of the respective disks and streaming along (or, in recent ZFS's case, coalescing the IOs to be in sequential order groups and issuing them), though certainly not all of them.
The logic "usually" goes that RAID5/RAID6 rebuilds are dangerous because they involve reading all the bits, so to speak, so if you don't have an equivalent of scheduled patrol reads to be sure bits at rest that haven't been read by users haven't gone south, you'll first discover this...during a rebuild, and with RAID5, you're SOL.
It's a sliding scale. SSDs intended for use in servers usually have more spare area than client/consumer SSDs, and most of their specifications assume they're full. A lot of enterprise SSDs also include features to allow the user to adjust the usable capacity, and the write endurance rating and warranty will scale to match.
From the SSD torture tests Ive seen, it is many petabytes of data that the average SSD must write before getting anywhere near "weared out".
This means that the minimum SSD write will be at least a few megabytes, including that few hundred bytes to that logfile. Likewise, every flushed write will round up to the nearest erase block, in size.
So, to write a few petabytes to the drive, you only need a few gigabytes of writes of per-byte-flushed data, since your actual NAND writes are amplified by a few million.
There's cache and many smart algorithms at play to minimize the number of erase block writes, but once you cause a flush (close the file, etc), you're performing a write to flash.
This is also why any embedded system with logging enabled has a very real maximum operating life. This is fun to discover the first time, when all of your customers start saying your product stopped working within the same couple of months.
Most SSD vendors will buffer write contents to collect a `write granularity` worth of data to avoid wasting bytes writing padding. This can be hard to do on drives without capacitors to supply backup power in the event of power loss.
Real value depends on block size and write algorithms employed.
Adding new bits is cheap, though, so if you can come up with an append-only strategy for your system and periodically combine those into a new, pristine version you'll get far more life out of your SSD than if you go around randomly flipping bits. Is Redis using memory-mapped files the problem here? Treating a file like memory is all fine and good until your random bit-flipping has to be directly persisted.
I wonder if future SSD firmware implementations will avoid wear by having a small buffer reserved for little post-write patches that can absorb a few small changes before having to commit to rebuilding the whole block.
There's talk of "annealing" as a way of restoring cells to full life: https://www.extremetech.com/computing/142096-self-healing-se...
Has anyone tried reflowing a worn out drive?
What those tests don't show by continuously writing and reading until absolute failure is the degradation in retention that occurs; a block that has been erased and rewritten over the specified endurance will almost certainly still accept writes, and even read back the same data, but is unlikely to retain that data for the specified length of time (several years, normally) --- instead, erasing itself soon after being written.
You are forgetting that Okmeter is a monitoring tool, not a backup warehouse. They are talking about the causes the fast wearout was made and how you could detect it with their product. Backblaze on the other hand is all about data storage and they have a good statistics because of massive amount of discs they use, so they are making reports about specific models and how they behave.
EDIT: It looks like "wear leveling count" attribute is available on Intel (#233) and some high-end Samsungs (#177), as well as other SSD, but it's not on any of my SSD.
Or you can just look for [0] directly if you just want to know what drives Media_Wearout_Indicator is currently defined for.
[0] https://raw.githubusercontent.com/mirror/smartmontools/maste...
$ sudo smartctl -A /dev/sda | awk '/177/ {print $2,$4} /241/ {printf "%.3f\n", $10 * 512 / 1024^3}'
Wear_Leveling_Count 097
4151.677
Just 4.1TiB written so far causes a 3% decrease in drive "endurance".It's attribute 231 for many vendors, 169 for several others, 202 for Crucials and Micron.
(Unfortunately I have a mix of SSDs in use, even in single personal computer, and all the vendor individual software gets overly complex and bloated...)
Better make sure the tool has a way to contact you if it finds an error! (Email by default - and test it!)
The long test reads the entire disk looking for errors.
Next, if you are using a Linux MD Raid array install mdadm and make sure it's configured to run a checkarray command (by default every month).
A short self test reads from random locations on the disk, it may or may not find anything, it's just a quick test.
Normally your hard disk will reallocate those bad sectors to other places, so you may not have any missing data, but once those bad sectors start they tend to keep going up. At some point your hard disk will run out of alternative places to store data.
But worse, any data in one of those bad locations is lost.
I would get your data off of the hard disk NOW. Then run a long self test and see if the numbers go up.
If your hard disk is still under warranty you should also go ahead and submit a claim.
Caveat: Some hard disks will create a bad sector if you power cycle it right in the middle of writing data. So a couple of those is not an indication of a problem. But 1,402 is rather a lot.
Post the full output of smartctl -a /dev/sda (or sdb, etc, whatever it is) and I can see if I can glean any other info for you.
[1] https://crystalmark.info/en/software/crystaldiskinfo/
Also relevant: https://ef.gy/statistics:ssd-write-endurance
On Windows there is Hard Drive Sentinel [1] and Diskovery [2]. Crystal Disk Info is a hit-and-miss, it's too prone to misinterpreting attributes and showing nonsense.
I have chosen to use it as part of a RAID1 for an OS install on a home server. Waiting to see how long it will last.
So if you have a write-intensive app like a Jenkins server building a C++ project, you might want to pony up for a server-class drive with better endurance.
Build in a ram disk and then copy whatever you need for permanent storage?
1) These disk, because of constant throughput, wore out.
2) These disk, because of constant throughput, are worn out.
techreport did a long-term experiment on this (but with limited samples): https://techreport.com/review/27062/the-ssd-endurance-experi...
I would love to hear any suggestions of what else we can gather and report.
For small samplesets, going deep to understand unnecessary writes, tuning the clients and showing less SSD wear after tuning would be interesting. Or, assuming you have more than 1 client of each of these situations aggregating the data to show patterns would be far more useful. As has been mentioned elsewhere, for inspiration, Backblaze has really nice posts analyzing their device wear.
But while we do have a lot of clients, I really think that all of their setups are unique in some way. So starting from that we didn't find more Redises on ceph dumping a lot.
> tuning the clients and showing less SSD wear after tuning would be interesting. Is just not an option for us, as we only do monitoring and don't have any ways of tuning.
When the level is low, capacity shouldn't decrease as there are spare blocks. There should be no data loss expect by catastropic block failurs (some SSD have internal RAID like redundancy.) There might be a slight performance decrease as the error correction algorithms become more active.
https://techreport.com/review/27909/the-ssd-endurance-experi...
Some just fail hard and that ranges from bricking to loss of filesysten intregity.
Others stop allowing writes.
Still others will slow down, or lose capacity.
I have had two die on me after a few years of work involving tons of writes. One cheap SSD just bricked. Gone.
The Samsung I had started doing weird things with capacity.
Personally, I just cycle them when I see a deal out there.
Old ones do need to be powered up, from time to time just like USB thumb drives do, or the contents can be lost.
Is it a known thing that Vendor X will brick, Vendor Y will read-only, or Vendor X Model XXX will brick while Vendor X Model YYY will read-only? If so, where can one find this level of information on the inner workings of a drive? Most tech reports are solely focused on read/write speeds as that's what the majority of people are concerned.
Inquiring minds want to know...
Totally agree. However, all of the SSDs that have failed on me all got bricked. I have never seen one that went into read only mode which was disappointing.
In fact, there are NO standard (or as the article coyly calls them "basic") SMART attributes at all. A lot of vendors stick certain attributes into same slots, granted, but there's literally no industry-wide spec for any of the attributes. You have to go not by vendor, and not even by device, but by firmware revision to accurately interpret an attribute.
The wearout indicator often sits at slot 233, but sometimes it will be in 230, sometimes - some other slot. Moreover, in some drives (e.g. OCZ or ADATA) 233 is undocumented at all and it will grow from 0 normalized.
So this:
> we implemented collection not of all the attributes, but only basic and not vendor-specific ones
is misleading and inaccurate.
I've had a 256GB Crucial SSD running on my primary dev box and it's been powered on for 3.6 years. During that time it's been powered on 94 times. I run a ton of Dockerized apps and other things.
The "wear leveling count" is at 163 which according to Crucial means the drive is at about 95% healthy.
It almost feels like Intel is squandering a massive advantage by not pushing it harder. I know Optane DIMMs are coming soon, but M.2 form factor would be nice as well.
Another great use case is for web/npm projects with a million dependencies, all flat file. Working with those is usually miserable otherwise.
In the future I intend to crunch time series data with it.
If anyone has a easy solution to this would be much appreciated. Right now I a just checking every few days to see if I did something silly that causes lots of paging. There was a time I don't think I need 32GB of Memory, now I think there is a real need.
-use different browser, Vivaldi supports suspending and lazy tab loading
-add more ram, in your apple case it probably means buying new laptop
Anyway, I spend most of my time in the software world and occasionally have to setup hardware (or more commonly, diagnose hardware issues). Is there a good guide for how to setup things like Postgres or Redis with recommendations on swap/cache setup, RAID-level selection, etc?
What did the server do?