3 ms·
My understanding with flash, having talked to someone who had to write his own wear-leveling code so his hardware could use cheap memory, is it's not so much th
by milesvp 8y ago
My understanding with flash, having talked to someone who had to write his own wear-leveling code so his hardware could use cheap memory, is it's not so much the pure throughout that can kill a flash cell, but the write pattern that matters. My memory of the conversation is a bit hazy, but it's something like, in order to update even a single bit in a cell, it needs to be deleted and written to, and each cell only has so many write statistically before it's flagged no good. So to detroy a disk, you can strategically flip bits all over your disk, or with a disk with naive wear-leveling maybe just flip the same bit over and over. Good disks will make this harder with tricks like buffers (hopefully backed by batt/cap in the event of power outtage), and very clever wear-leveling algos, but you can definitely wear out flash memory with a fraction of the data and time you might expect if you have a truly pathological workload.
- astrodust 8y agoFlash memory is different from a regular drive, and it's to do with how it writes. You can't alter a single bit, you must rewrite the whole block and those can be anywhere from 256KB to 4MB or more. http://codecapsule.com/2014/02/12/coding-for-ssds-part-2-architecture-of-an-ssd-and-benchmarking/ http://codecapsule.com/2014/02/12/coding-for-ssds-part-2-arc... 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-self-heating-flash-memory-survives-more-than-100-million-cycles https://www.extremetech.com/computing/142096-self-healing-se... Has anyone tried reflowing a worn out drive?
- planteen 8y agoFlash must be erased on a page boundary, the size of which varies, but ranges from 512 bytes up. The act of erasing a flash page turns all bits to 1s (0xFF for the entire page). When the flash IC breaks, you can usually tell by doing a blank check after erasing. Instead of being 0xFF all over, some bits will be "stuck" to 0. A common reason for a discrete IC flash part wearing out is that charge pumps are used to raise a low voltage like 3.3 V to 12-15 V which is required for erasing. These charge pumps are touchy and can die first, from what I have heard.