Q. I heard solid state disks (SSDs) suffer from a decline in write performance as they're used. Why?
April 20, 2009
A. SSDs behave very differently from traditional mechanical, platter-based hard disks. SSDs are made up of cells that each store one bit of data (in Single Level Cell, or SLC, drives) or more than one bit (in Multi Level Cell, or MLC, drives, which currently only store two bits per cell but could store more in the future). The two types of SSD are made the same way, but it takes longer to read and much longer to write to MLC because you have to use larger voltages to check the possible data values. These cells are organized into pages, the smallest readable/writable unit in most SSDs, and are normally 4KB.
These pages are then organized into blocks, traditionally 128 pages per block, for a block size of 512KB blocks. This is important because this is the smallest structure that can be erased. You can read and write at a page level, but you can only erase an entire 512KB block.
This means you can read 4KB at a time and write 4KB at a time to empty space, but you can't overwrite a page. You must first erase the content, and because you can only erase at a block level, you basically have to read the entire content of a block to memory, replace the pages with new content in memory, erase the entire 512KB block, then write back the entire 512KB block. All of that reading and writing just to change even one bit! The good news is that the controller for the SSD has memory and a processor to do this, so you aren't going outside the SSD, but this is still a lot more data than the small change. This process is illustrated here.
Click to expand |
You have 8KB (two pages) of data to write. Two pages on the target block contain deleted data, shown as red pages, and are available to be overwritten.
The content of the block is copied to the memory cache.
The updated 8KB of data are written in the cache over the pages that previously contained the deleted data. The block is erased and is completely empty of all 512KB of data.
The updated content of the memory cache is written back to the block. The 8KB write operation is complete.
The firmware in the SSD works around the problem of writing entire blocks to limit overwriting where possible. The SSD will instead write to every page on the SSD before starting to perform performing overwriting, which requires erase operations. Many SSDs actually ship with additional space they don't advertise to delay overwriting.
There comes a point, however, when every page has been written to and you have to start overwriting data. At this point you enter the 512KB block read, update, erase, then write sequence, which is where you traditionally see write operations slow down. Note that read operations aren't affected by this problem.
Even if you're saving a brand new file, when you delete something under NTFS, the data on disk is not actually touched. Rather, the pages are marked as available, so when you then try to write to them they must go through the block-writing sequence because there's still data in the block, even though at a file system level the pages are available.
Another item to consider is that typical MLC memory can only be erased 10,000 times before it stops storing data and your SSD is useless, so you need to limit writing to them when possible.
SSD drives suffer from write degradation over time because more of the writes require erasing whole blocks. There are firmware updates for many SSDs that try to reduce this degradation, but there are limits to what the SSD controller can do. The controller has no idea which data is actually available to be deleted, because the OS never tells it during a delete operation and the SSD controller only finds out once it gets instructions to overwrite the data.
Related Reading:
SSD Announcements Precede CES
More storage articles
Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
About the Author
You May Also Like