SSD Speed TweaksTweaking guide for optimizing Solid State Drive performance and reliability
2010-02-11 (updated: 2019-12-08) by Philip
Tags: ssd, tweak, defragment, pagefile, system restore, hibernate, superfetch, TRIM, MLC, TLC, SLC
Solid State Drives (SSDs) have a great potential to speed up your system, and they're becoming mainstream with prices dropping and the technology maturing. SSDs are faster, have no moving parts, use less power, are quieter, less succeptible to physical shock, with lower access time and latency than traditional mechanical hard disk drives (HDDs).
However, SSDs use memory chips to store data, which makes them quite different than traditional mechanical drives and most current OSes are still not tuned by default to use this type of storage media to its full potential. It may take a bit of knowledge and tinkering to setup and tune the SSDs and squeeze that last bit of potential and improve their reliability.
This article aims at some general principles in improving the speed and reliability of Solid State Drives, discussing some tweaking recommendations. Even though most tweaks are illustrated under Windows 7/Vista, the general ideas can be applied to any OS. In a couple of words, the main idea behind SSD tweaking for performance revolves around partition alignment, enabling TRIM, reducing unnecessary writes (very fast drives with somewhat limited write cycles), and freeing up space where possible. Note that newer generation, and more expensive SSDs have improved write endurance.
Windows 7 is better at recognizing and working with Solid State Drives (SSD) than previous versions of Windows. It has the ability to detect SSDs and set the disk defragmentation service to manual, even use the TRIM command on some drives. Even with these basic optimization steps, there is always some room for improvement, as outlined below.
SSD reliability has been a topic of discussion ever since the inception of this technology, and should be an important factor when tuning your drive in addition to performance. SSDs use NAND-based flash memory, which is able to retain data without power. To reduce production costs and push higher capacity SSDs, manufacturers have to either shrink the NAND die size, or increase density of the data on the same die. There are three common types of NAND flash used in SSD drives today: SLC, MLC and TLC. A newer "eMLC" improved type of MLC flash is gaining popularity as well. It is important to know the differences in reliability in the different flash types.
SLC (single layer cell) - up to 100,000 program/erase cycles per cell, high performance, fast write speeds, high cost, good fit for industrial grade devices and critical systems. SLC flash has only two states: erased (empty), and programmed (full).
eMLC (Enterprise multi layer cell) - 20,000 to 30,000 program/erace cycles. Improved version of the multi-level cell flash memory that has higher reliability and write endurance. An eMLC could be 2-bit, while MLC can be 3 or 4 bit.
MLC (multi layer cell) - 3,000 to 10,000 program/erase cycles per cell, much lower endurance limit than SLC, lower cost, typically used for consumer grade products. MLC flash has four states: erased (empty), 1/3, 2/3, and programmed (full).
TLC (three layer cell) - 1,000 to 3,000 program/erase cycles per cell, lower endurance, best price point, good for lower-end consumer products, not intended for critical applications. TLC flash has eight states: erased (empty), 1/7, 2/7, 3/7, 4/7,5/7,6/7, and programmed (full) Note that even with the lower reliability TLC flash, a typical consumer PC that writes about 10 Gb of data every day can still use the drive well over 10 years before the NAND flash wears out. However, the size of the drive (larger is better), tuning the drive, and reducing writes can greatly impact your experience over time.
SSD Partition Alignment
increase write speed and lifespan
SSDs are divided into blocks composed of multiple pages, and each flash block must be fully erased prior to re-writing. The write speed will suffer greatly if the SSD controller has to perform unnecessary block erase operations due to partition misalignment. Proper partition alignment is one of the most critical attributes that can greatly boost the I/O performance of an SSD (and increase its lifespan) due to reduced read-modify-write operations.
In essense, you simply have to align the partitions for best performance. I don't know of an easy way to realign a partition after the drive has been formatted (short of ghosting a disk image, aligning the partition and restoring it).
Some geeky technical info
In fact, for best performance the partition offset should allign with (by being a multiple of) all three of the following:
NAND Page Size - generally 4KB
Windows SSD alignment
Note: to create a partition of specific size (100MB), use: create partition primary00 align=1024
To verify the alignment:
You should see a result similar to this:
Partition ### Type Size Offset------------- ---------------- ------- -------Partition 1 Primary 128 GB 1024 KB
512KB or 1024KB is best, even though any multiple of 64KB should be somewhat ok (aligns to two out of three parameters, with the exception of erase block size).
Under Linux, you'd have to use something like: 32*7=224 heads and 8*7=56 sectors/cylinder for 256*49=12544 sectors/cylinder, so that each cylinder is 49*128K.
avoid write performance degradation over time
Traditionally, when you delete data on a disk, the data isn't immediately scrubbed, just marked as overwriteable. Given the way SSDs store and overwrite data, it is advantageous for the drive to use the TRIM command and scrub deleted data instead of performing an entire block erase when you are writing new data.
In essence, TRIM support handles deletes/writes in a way that avoids write performance degradation over time to the involved blocks. As an added benefit, the TRIM operation can help reduce wear by reducing the number of merge operations on a SSD drive. You can think of it as the SSD equivalent of defrag/disk cleanup for SSDs that support it.
For the TRIM command to work, it has to be supported both by the SSD and your OS. This may require firmware upgrade of older first-generation SSDs. It can sometimes be accomplished with third-party software for older OSes (and even drives) that do not support it natively.
TRIM Support by OS:
To check whether TRIM support is enabled under Windows 7, in elevated command prompt, type:
You may also need to verify that your ATA/ATAPI AHCI controller is using a TRIM compliant driver. For Intel chipsets, instead of the default MS AHCI chipsed drivers, download and use the newer Intel chipset drivers 184.108.40.2064 or later for TRIM support. For non-Intel chipsets, navigate to:
Increase System Speed
Under most current versions of Windows, Indexing creates and maintains a database of file attributes of hard drives. This can lead to multiple small writes when creating/deleting/modifying files. Searching for files works with indexing off, just a bit slower. You can turn indexing off for all drives, or just for the SSD at your discretion.
Alternatively, you can stop the indexing service for all drives:
Even if the search index is disabled for the SSD, the default index file location is under "C:Program DataMicrosoftSearch", so if you are using the SSD as your OS drive, and have other drives in the system, their index may still be written to the SSD. The index file can be moved from its default location to another drive by navigating to:
Defragmenting a hard disk's used space is only useful on mechanical disks with multi-millisecond latencies. Free-space defragmentation for SSDs is not available in the default Windows Defragmenter. Also, defragmenting SSDs may theoretically shorten the lifespan of the drive. To check if your SSD is scheduled for defragmenation, or turn off the service, follow the instructions below.
Start Menu > type: dfrgui in the search dialog -> highlight your SSD drive in the list -> click "Configure schedule" -> untick "Run on a schedule"
Alternatively, to stop the service if you only have a SSD in the system:
Note: Windows 7 should turn defragmentation for SSDs off by default, but it should be verified.
Disable/Move the Page File
Save disk space, reduce writes
As drives have a limited number of write-cycles, it is generally a good idea to reduce unnecessary writes to your fast/expensive SSD. It has the added benefit of freeing up over 2GB of disk space.
To set a custom size (or disable) the Page file:
Note: If you completely turn off the Page file, and run out of memory, the program you're running will crash.
Disable/Reduce System Restore
Save disk space, reduce writes
The System Restore feature allows for software installations, drivers and other updates to be rolled back. Disabling this feature can free up between a couple of hundred Megabytes and a couple of Gigabytes. You can turn down the amount of disk space System Restore can use, or turn it off completely at the risk of not being able to automatically recover from problems caused by system changes.
To change System Restore (or disable it completely):
Save disk space
You can free up SSD space, (up to the amount of your RAM) by disabling the Hibernation feature in Windows. By default, the size of the hibernation file (hiberfil.sys) is the same as the amount of installed RAM on your computer. Naturally, disabling Hibernate will prevent you from using this power-saving mode.
To disable hibernate (needs elevated command prompt):
Note that Windows does not always delete the hybernation file (called hiberfil.sys under Windows 7), which takes up 75% of your RAM size, i.e. it would take up 6GB of storage on a system with 8GB RAM. To verify the existance/absence of a hibernation file, drop to command prompt and type: dir c: /as . Look for a file called hiberfil.sys . You can remove the hibernate file with the above "powercfg -h off" command in elevated command prompt.
To enable hibernate, under elevated command prompt, type: powercfg -h on
Alternatively, hibernation can be enabled/disabled using the registry editor:
Hibernate can also be disabled from the Control Panel, under Advanced Power Options (Sleep > Hibernate after), however, it does not delete the hiberfil.sys file.
write combining (NCQ)
To change the write-caching behavior, navigate to:
Notes: The main benefit of leaving write caching on is NCQ, or write combining. Only if you use a UPS, to squeeze the last bit of performance from write caching you may try ticking the second option under the write caching policies tab.
Configure Prefetch & SuperFetch
Free up RAM - do not preload program files
Prefetch is essentially a disk optimization mechanism. It monitors fragments of executable files that are commonly used together, and causes them to be laid out next to each other on the hard disk. SSDs have extremely low seek times and no rotational delay, so access times are not dependent of the location of particular segments. Prefetch therefore loses its main purpose. In addition, reducing writes to the SSD is part of optimizing its performance, so prefetch should be disabled.
Superfetch is a predictive RAM preloading mechanism. It preloads program files into memory. Its benefits are limited with SSDs, so it can be disabled, or you can safely use more conservative settings than the defaults with it.
To make changes to the Prefetch/Superfetch behavior, open regedit.exe and browse down to the following key:
While there, you may also want to turn off:
Reduce the Recycle Bin size
Even though it does not affect speed, reducing the maximum Recycle Bin size to 200 MB for example can help to free up space and reduce writes to your SSD:
Right-click on the "Recycle Bin" icon -> choose "Properties" -> Custom size -> 200 MB
Note that deleted files in the Recycle Bin are only marked for deletion, without being physically moved on the disk. However, excessive Recycle Bin size can lock a considerable percentage of your drive with unnecessary files - that additional available space helps leverage writes over more cells.
Delete Temporary Files
There are a couple of places where Windows stores temporary files, old backups of system updates, Service Pack backup files, etc. All those can add up to several Gigabytes of unnecessary data that can be safely cleaned by deleting those files, as follows.
First, use the "Disk Cleanup" tool:
Open Windows Explorer, right-click on the C: drive -> choose "Disk Cleanup" from the pull-down menu. Be patient while the next dialog comes up. It is safe to delete all those listed files, including "Clean up system files".
There is much less known Temporary file location used by the "system profile" that can take from 1 GB, up to in excess of 20+ Gigabytes and over a million of unnecessary temporary files. It is not touched by Disk Cleanup and it just keeps growing with time. To see the folder below, you will need to configure Windows Explorer to "Show hidden files, folders and drives", and uncheck "Hide protected operating system files" from the "Organize -> Folder and search options" menu.
To clean up the system profile temp files, in Windows Explorer, navigate to:
C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5
It is safe to delete all files in that Temp folder.
For some systems that have several Gigabytes and millions of files in that folder, Windows Explorer may take a very long time to open it. In such instances, you can delete the files from Admin Command prompt, by typing:
cd "C:\Windows\System32\config\systemprofile\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5"
Note: If files keep appearing after you clear the above folder without any apparent activity, you may want to check your computer for malware. Visual Studio .NET logging may also add files to this folder.
Firefox - Use memory cache
reduce disk writes
Firefox has the ability to write cached files to RAM instead of the hard disk. This is not only faster, but will significantly reduce writes to the SSD while using the browser.
To change the cache location to RAM:
IE - Move Temporary Internet Files
reduce unnecessary disk writes
To further reduce unnecessary disk writes to the SSD, you can move Internet Explorer temporary files to a separate mechanical drive.
In Internet Explorer, navigate to:
Reduce other unnecessary disk writes
Even though not necessary, below are some ideas about reducing disk writes further, at your discretion:
reduce logging - Windows 7 writes extensive event logs. With the exception of some necessary logs (EventLog-Application, Security, System, Security Essentials), you can safely stop some logs that write to the drive periodically:
Windows reliability monitor - it provides an overview of hardware and software problems over time. It writes to the drive on events, and every hour. It can be stopped (or slowed down) on a stable system at your discretion:
Disable Unnecessary Services
To further reduce disk writes and overall system load, you can disable some unnecessary services. To do so, either run "services.msc" from the start menu, or navigate to:
Start > Control Panel > System and Security > Administrative Tools > select Services and click Open
For each running service that you want to disable, you will have to:
Right-click on the service, choose properties, stop the service, and change it's "Startup type" to either Manual, or Disabled.
You can disable the following services to reduce disk writes and system load:
Diagnostic Policy Service
Linux users may want to check our Linux SSD Tweaks article as well.
Any additional tips and feedback are always welcome.
by anonymous - 2011-06-22 09:07
by anonymous - 2012-01-02 15:22
by Philip - 2012-01-02 18:10
As with any drive, you should leave at least 10% free for temprorary files, swap space etc. (if they're not moved to other HDDs).
In addition, lack of spare capacity will impact the garbage collector's ability to remap free blocks and maintain write performance. Read performance should not be affected by lack of free space.
As a rule of thumb, I wouldn't use much more than ~80% of the drive to maintain optimum performance.
by Jeff - 2012-03-06 05:14
Thank you for the informative guide.
I have a quick question about verifying that the ATA/ATAPI AHCI controller is using a TRIM compliant driver. Well, I followed your steps to select the "Standard AHCI 1.0 Serial ATA Controller" and after reboot I checked back in the device manager and now for some reason I have two of the "ATA Channel 0" and two "ATA Channel 1" and also additional "ATA Channel 3." Is that ok? Everything seems to be working, but I was just wondering what is going on. I took a screenshot so you could see what I mean.
Thanks for your help.
by goytabr - 2012-03-13 23:22
I would like to point out that just unchecking "Allow files on this drive to have contents indexed in addition to file properties" does NOT necessarily prevent the Windows Search index from being written on the SSD. This is for two reasons:
1) Even with that option unchecked, Windows Search can still index folders, subfolders and files on the SSD if they are on its list of locations to be indexed.
2) Presently, very few PCs use solely SSDs for storage, because for most users and purposes, they are still too expensive to be a feasible mass data storage medium. So, most users will combine an SSD with one or more HDDs, and the latter can be indexed as well (and usually are). By default, Windows 7 stores the index for *all* indexed locations in "C:\Program Data\Microsoft\Search". Therefore, if there is any indexed location on another drive, its index will still be written to drive C:, which is usually the SSD.
Moreover, that action attacks the wrong problem. The problem is not the SSD being indexed (which, depending on the user's needs, at least for some folders and files may be very useful and even necessary). The problem is writing the index on the SSD, which is an operation that involves extremely frequent writes and updates and thus can degrade the performance significantly.
There are two real solutions for this problem. One of them was already given above: disabling the Windows Search service. This will definitely work, but in my opinion, that's throwing the baby away with the bath water, because all indexed searches will become unavailable. Indexed searches can be extremely useful in many instances, and while it can be argued that an SSD is very fast and indexing would be unnecessary, it's still much faster and more efficient to search a few kB in the index than (in many cases) several gigabytes of data - even on an SSD.
The other solution - much better, in my opinion - is moving the index from its default location to another drive, specifically an HDD: somewhere like "E:\Index", for example. This will allow indexed searches to still be performed (including on locations on the SSD) while not taking any space on the SSD and not overloading it with excessive write and update operations - the best of both worlds.
This can be easily done by going to Control Panel - Indexing Options - "Advanced" button (admin privileges/UAC required) - "Index Settings" tab - "New location, after service is restarted" - "Select new" button - browse to desired folder - OK - OK - Close. Usually the service is automatically and immediately restarted, but just in case, go to the Services utility (services.msc), stop and restart the Windows Search service.
by n9nu - 2012-04-09 22:15
You could do all those tweaks manually, or you could grab the FREE version of:
SSD Tweaker for Windows
Optimize Windows XP, Vista and 7 for SSD Drives With all the advice online for SSD hard drives it can take hours of research and fiddling to properly setup your SSD drive. Now with this little app you can Tweak Windows 2K/XP/Vista & 7 including x64 in seconds.
SSD Tweaker Lets you Tweak the following:
Windows Services (Pro Only)
Query and Set Windows 7 TRIM Status (Pro Only)
Experimental TRIM Optimization (Pro Only)
Hibernation Settings (Pro Only)
Use Large System Cache
Ntfs Memory Usage
Disable 8.3 Filenames
Disable Date Stamping
Disable Boot Tracing
Windows Vista Superfetch
Windows Indexing Service
DIPM Enable Support
You can also buy the Pro version which will unlock some of the more advanced tweaks. I might have a reg code around somewhere......
by Clement store - 2012-09-17 07:50
Have been such a useful and detailed account of SSD partition alignment.
I wonder if my guess is correct. Here's my config.
OS: windows server 2008 x64
Database: Oracle 10g x64
IBM SSD 128GB x 4 ( single micron controller in each SSD running in raid 10 )
Would the partition aligment still be 1024k even I have 4 disk?
Strip size shud be 64k optimal as I see.
Thanks a lot.
by anonymous - 2015-01-04 03:43
Not sure why someone would recommend using the "turn off buffer flushing".
Almost all intel based ssds will have bsod problems and a performance drop up to 50%.
A UPS for the pc is NOT a battery on the drive itself. "... Unless the DEVICE, (not the pc) has a SEPARATE power supply...
This is meant for enterprise use, where hdd/ssd have their own BBU to keep data in the cache available until the computer is running again.
Using this setting can corrupt the drive just by shutting down windows and power from the psu is "cut" while the drive was still in progress of writing cache data to disk/flash.
Furthermore, this setting is based on a win bug which has been fixed since 95(?!),
But there was software being used that slowed down with the bug fix and MS was blamed to have done this on purpose and to push MS software.
Hence this setting enables the bug on newer OSs, more or less for legal reasons,
And should not be enabled by 99.9% of users, unless each (enabled) drive has its on battery for power backup....
by anonymous - 2015-01-18 02:49
great tips except that leaving only 10-20% capacity will still have an impact on drive life.
to "prevent" write amplification, 30-50% of the ssd SHOULD NOT be used and left unpartitioned.
this has been shown in different test, and as far as I remember there is some info on toms hardware guide about it.
most decent 240-256gb ssd's (M500 or 550/vertex 150/vector 460/ARC) run around 100$.
enough to install windows on a 180gb partition, and leave the rest, which will help performance (a bit) and enhance life expectancy.
and I can fill up the partition without probs...