PSA: Streaming n-grams from SSD will cause SSD wear

Wait 5 sec.

In other news: eating a banana gives you a dose of radiation, and spending a lot of time sitting at a desk can have negative effects on your health. Still you're doing it, so don't panic :-) Anyway, here is what happens: Read disturbance: Voltage is applied when reading from a SSD. This changes the voltage levels of adjacent cells a bit. While the more expensive SLC (single level cell) SSDs have quite a bit of room for error there, the more common TLC and QLC (quad level cell) SSDs have way tighter budgets. In the example image "cell" 35 (well, actually "word line") is read 54K times, which then causes the adjacent cells 36 and 34 to eventually hit the ECC limit (paper here). When they reach it then the stored data is irreversibly lost. Of course SSDs won't let that happen. Read reclaim: The SSD controller will relocate full SSD pages to a fresh region well in time before the data is lost due to hitting the ECC limit. That also means that it takes less than 54K reads (on that tested SSD) to trigger a relocation. That relocation is a page write. Reads thus trigger writes eventually. There's another paper that has some graphs on how the read rate degrades during extensive reads, due to the SSD relocating pages in between. You can see in the middle diagram that more balanced reads take quite a bit longer until they hit the ECC limit. Still, it happens eventually. How much it happens differs based on the SSD and the usage pattern. Unfortunately, both papers don't provide a lot of concrete data here. What you can do: If you have your n-gram table stored on a dedicated SSD that should not get any writes during normal operation: Look at your SMART counters and check how fast "data units written" or "LBAs written" goes up while just streaming n-grams and share some data here. This would help to see whether that effect is more like eating a banana, or like an airplane flight when it comes to radiation doses.   submitted by   /u/Chromix_ [link]   [comments]