Conversation started Feb 21, 2017 at 23:44.
Feb 21, 2017 23:44
@UTF-8, I gave your question some thought and I thought I might have a more detailed discussion. The gist of the issue you're experiencing is that the SSD is internally running out of spare space. SSDs try to spread writes out across whatever free space is available, but if you've written to a particular block before, the SSD's controller will always think that block is in use even if the data is deleted from the filesystem. TRIM tells the SSD the space is no longer in use.
Over time, all the blocks get written over, and random writes can cause data to take up more space on the NAND as the drive spreads out writes. This is because blocks can't be erased directly; see superuser.com/questions/944913/….
@UTF-8 It's complicated, but because the drive can only erase large chunks of data at a time, there tends to be lots of partly-filled blocks.
The SSD will try to erase blocks only as needed to avoid excess wear. Stale pages in each block aren't overwritable; the whole block needs to be erased. Hence, random writes can cause data to take up more space than its actual size.
With TRIM, though, the drive will know that those stale blocks are in fact stale; otherwise, the drive will just treat them as containing valid data. This will cause it to internally run out of spare space faster as it's maintaining stale data.
Long story short, 1 GB of random writes can actually involve more than 1 GB of physical NAND, so they can cause the spare area on the drive to run out faster.
In fact, the drive may actually have less than 30 GB of spare area available even after TRIM because of the way writes are distributed across blocks. Again, SSDs try not to erase and rewrite blocks unless they really need to, so even if your filesystem has 30 GB of free space and you've TRIM'ed the space, there's likely still some stale data on the NAND waiting to be erased at a more appropriate time. The best solution is ultimately to free up more space on the drive.
Conversation ended Feb 21, 2017 at 23:59.
Understanding how free space and TRIM impact write amplification
Feb '1721
Participants
- bwDraco 69%
- Bob 23%
- UTF-8 7%
all times are UTC