Monday, October 3, 2011

Optimize Your SSD


SSD basics
SSD is a abbreviation for 'Solid State Drive': a 'drive' with no mechanical parts, but with a conventional disk-interface (usually SATA).
An ssd contains memory chips (flash memory) to store the data.
The biggest advantage is data is almost immediately available, without the need of moving a mechanical head to the area on the hard drive where the desired data is stored.
At this moment pc-components such as the processor, memory (ram), graphics processor and other components, perform well enough to meet the demand of the most users. Still we have to wait while using a computer...
So where can performance still be increased dramatically? The answer: ssd's!
In 2009 prices of ssd's have dropped by a factor 4. Still at this moment ssd's are much more expensive than hard drives: ssd's now cost around $2.5 per GB, incontrast to approximately $0.1 per GB for conventional hard drives.
But, there is such a raise in perfomance! An example of a comparison of a much sold ssd over a very fast hard drive - behold and enjoy:
An ssd (Intel X25-M G2 'Postville' 80GB):
A fast hard drive (Western Digital Raptor 80GB):
An ssd causes starttimes of applications to speed up by a factor 5 to 10: applications often seem to start almost immediately with an SSD.
Starting an operating system can be fastened by a factor 2.
Do I need SSD tweaks to get my ssd working without problems?
No, you don't! An ssd will perform very well from factory, especially compared to a conventional hard disk!
So if you do not want to fuss, then skip these tips; they are meant to squeeze that bit more out a ssd than is possible by default, especially for Windows XP and Vista, which does not have advanced support for ssd by themselves.
Terminology
Garbage collection: part of the functionallity of the firmware of ssd's that automatically merges fairly unused memory blocks for better performance
Under-partitioning: leave blank space for better performance
Wiping: OCZ method (tool) to improve performance
Aligning: creating a partition with a size that is exactly the cluster size multiplied by a factor
TRIM: a future ATA (contoller) command from the operating system to an ssd, that can tell that a memory block on the ssd can be erased to improve write performance - it will be a standard feature of Windows 7, but SSD's and raid controllers must support it
Wear leveling: spreading write-actions on memory cells evenly over the whole ssd - this prevents wear of the flash cells increasing their liftetime
GB or GiB: Intel specifies a GB as 1000.000.000, and OCZ as 1024 * 1024 * 1024 bytes (also known as MiB) which is nearly 7.4% more
MLC / SLC: Multi Level Cell or Single Level Cell - the latter lasts longer, is theoretically faster but more expensive, so mlc-based ssd's are now sold more, especially to consumers. Wikipedia: MLC vs. SLC
Tips for Linux
Tips for OS X
Tips for Windows / in general
Partition alignment: yes
Defragmentation: no
Indexing: no
Swapfile on ssd: yes
Under-partitioning: choice of user
Software caching: yes to JMicron, other ssd's: choice of user
Wipe (OCZ): Yes, but not until Windows 7 TRIM raid and support
Raid controller: choice of user
AHCI: preferably enabled
Below the explanation in detail - many of these points are applicable to generic SSDs, and not specific to Windows.
Partition Alignment
Alignment means to create a partition with a size that exactly one whole factor multiplied by the cluster size (eg 4096KB).
If the partitions are not 'aligned', one read / write operation from the operating system may in the worst case perform two physical read / writes.
Alignment on Windows only works with NTFS partitions.
Windows Vista (SP1 and later) and Windows 7 always create alignded partitions.
If you want a partition to be alignded when installing Windows XP, use the installation dvd of Vista or Windows 7 just to create the partitions, or use BootIT, or follow one of the many guides on the Internet.
And if you want to create and restore an image?
If you create an image of your entire ssd and restore it, you lose the alignment with most currently available cloning-software.
If you only create an image of a partition and restoring that, the alignment is not lost.
Defragmentation
Defragmenting an ssd has virtually no effect on performance.
Some benchmarks show a small profit, but in practice it is not noticeable.
Defragging however performs a huge lot of write operations, so that the lifetime of an ssd can be shortened.
Indexing
It is tested that indexing a ssd (a feature of the operating system) makes no difference in performance.
With Windows 7, indexing automatically turned off when it is detected that an ssd is connected - for other hard drives in the same system the indexing will still be activated.
Swap File
An operating system can write a lot to a swap file, so when you put a swapfile on your ssd, lifetime can be shortened.
But the performance gain however is noticeable, and as long as you have enough memory in your system - and modern memory (DDR2 / DDR3) today is not expensive - your swap file is hardly used.
Many people disable the swap file by hand (often they use 4GB ram or more), especially when using an ssd.
Under Partitioning
Some SLC ssd's such as the Intel X25-E series, contain more flash memory than that can be partitioned.
Thus the firmware has more free memory blocks to write to, which significantly boosts performance.
It has been tested whether this trick can also be used on other ssd's, and that works!
When you create a partition with approximately 90% of the maximum size of the ssd, the performance will stay much more consequent even when the partition gets full.
You 'throw away' some space however.
And probably it is not necessary to use this tweak in the future, when Windows 7 and the ssd's support the TRIM command.
Caching
By default operating systems turn on software caching (also called write-back caching) for hard drives and thus also for ssd's.
This is fine, and there is no reason to turn it off.
Better still: for ssd's with a Jmicron controller it is a must!
Wiping
For OCZ ssd's there is a tool called the Wiper tool. You can download this from the OCS website.
This empties unused memory blocks and removes them from the address table, so that they are available for optimal write speed.
Although the firmware of OCZ ssd's has improved to include garbage collection algorithms, wiping is still advisable.
Note that this is not always infallible: sometimes data corruption has been reported in x64 versions of Windows when using this tool.
You can also Wiper.exe scheduling so that every day / night / week / month takes place!
Wiping is probably not necessary any more when Windows 7 is used with the TRIM command set.
There is also a garbage collection tool from OCZ, but with the latest firmware with built-in garbage collection that is no longer needed.
Using a raid controller

A decent ssd is already much faster than a regular hard drive, but some users have good reasons to put ssd's in a raid configuration, such as professional or server applications. 
Here is a nice example of a lot of ssd's in raid: Samsung SSD Awesomeness.
A warning: the OCZ wiper tool most often can not be used when ssd's are used in raid, because most raid controllers do not support the commands that are sent by that tool.
Result is that performance degradation occurres in raid-configs, and that while the whole point is increasing the performance with a raid-configuration.
When Windows 7 is used, and an ssd and the used raid controller support the TRIM command, this problem will be of the past.

AHCI

AHCI is a comprehensive command set for SATA, and includes NCQ (Native Command Queing). 
Initially, the assumption was that NCQ would not have impact on SSDs. 
But wow it's proven that certain AHCI-features do work, as tested here.
So enable AHCI (sometimes called 'advanced' at the SATA controller settings) in the computer's bios.
Warning: with XP you should use an sata driver floppy when AHCI is enabled, or you can use nLite to slipstream the AHCI driver to the Windows XP installation disc.
Windows Vista and Windows 7 would carry more AHCI drivers on the installation-dvd's, and otherwise you can use a usb stick instead of a floppy to install the sata driver.

Model-specific tips
For systems with an Intel chipset with Intel Matrix Storage raid controller: note the way to connect your SATA ports on the motherboard.
Booting delays were encountered when SATA1 and SATA2 for respectively the ssd and the harddrive were used.
If the ssd was put on SATA 1, the harddive on SATA3 and a dvd burner on SATA5, there was no problem.

Choosing an ssd
Models with a Indilinx controller (OCZ many models, but also the Super Talent Ultra Drive Me and other brands) or models with Intel's controller (X25 and X18 series) are fine, nothing to complain about.
The choice between Intel and Indilinx depends on where you most want the ssd to use.
Intel provides faster read and write speeds for large amounts of small files, but the Indilinx controller can better handle large files and thus has higher sequential read performance.
Also for random access to large files such as databases, the Intel ssd's are better. You notice this for example in Apple OS X's Spotlight feature to search your files, or when reading metadata from iPhoto or Mail.
Models with Samsung controller (such as Samsung's own ssd's or some OCZ models) are also recommended, though the read-write speeds are lower.
Ssd's with a JMicron controller however (OCZ and Kingston models) have initially caused much disappointment and frustration.
Meanwhile the firmware of ssd's with a JMicron controller have been improved, but because people are very reluctant buying an ssd with a JMicron controller, it will take a while until the appreciation for those ssd's will improve.

No comments:

Post a Comment