Sunday, July 19, 2009

Poor SSD's File Writing Performance on Windows

SSD (Solid State Drive) is undoubtly fast and will be the favor of performance choices over the current mechanical hard drive.

However, when this SSD is run with Windows OS (e.g. XP or Vista), the performance will drop significantly.

Active applications can also stop responding for about 1-2 minutes (followed by irresponsive mouse), when browsers like IE/firefox are being opened up and navigated to certain heavy websites.

This is because the Windows' file read/write mechanism is optimized for hard drive's mechanical movement (as compared to Linux, which is block-by-block)

When writing a file, the entire block on SSD has to be erased before it can be written. The drive cannot be written over the top of pre-written data.

This adds latency as every bit written to the drive has to be preceded by a bit erased and the random writes fill up the write buffer on the drive, causing the SATA controller to pause when the data are being flushed.

Visit these links for more detail about SSD's block-rewrite penalty:
- http://techreport.com/articles.x/17136/2
- http://techreport.com/articles.x/17136/4

So, the bigger the SSD capacity you have, the bigger the block you will have (and the slower the XP or Vista you will get :-))

Any workaround?

Yes, just install Windows SteadyState (which currently only supports for XP/Vista 32-bit only), or use Linux with NILFS.

---
Update on 09/13/2012 :

It has been very busy for me in these past three years to spare the time on writing the blog. Perhaps I will not have luxury to update it so frequently anymore.
 
Too bad that the Windows SteadyState is already discontinued with some limitations in which it can only work in the 32-bit Windows. 

It was also found out that the partition misalignment was actually the major cause for these performance penalties. 

So, partition misalignment combined by old XP or bad vista, will just cause our SSD to become useless :(

For some background on it, SSD and new generation of HD require the partitions to be aligned with the 4K sector size. 

When the partitions are misaligned, there will be overhead in the reading/writing of random block files to cause performance penalties as well as shortening the write endurance (called as "write amplification"):
 
- http://dfarq.homeip.net/2011/07/why-you-should-align-your-ssd/
- http://www.msc-ge.com/en/news/pressroom/essays/7480-www/6318-www.html#dsy6318-www_3.2

Some more links about partition alignment on SSD:

- http://dl.paragon-software.com/free/Paragon%20Alignment%20Tool%20-%20White%20Paper.pdf 
- http://lifehacker.com/5837769/make-sure-your-partitions-are-correctly-aligned-for-optimal-solid-state-drive-performance
- http://siduction.org/index.php?module=news&func=display&sid=78&lang=en 

Happy upgrading the HD to SSD :)