Site menu:




Windows 8


Optimize Windows 8 for use with a Solid State Drive (SSD)

By: Arie Slob

Windows 8
« Previous   1   2   3   Next »

Microsoft got most things right with Windows 8 and Solid State Drive's (SSD drives have been around for a few years now). There are just a few things you have to check, the most important one is if your SATA controller is running in IDE or AHCI mode.

SATA - AHCI

To improve performance, make sure that your hard drive SATA mode is set to AHCI (Advanced Host Controller Interface) in your system's BIOS. AHCI exposes SATA's advanced capabilities - such as hot swapping and native command queuing (NCQ) - such that host systems can utilize them. Specifically the 'native command queuing' will give SSD drives a performance boost.

You should take note however: If you already have Windows 8 installed and want to change your SATA mode from IDE mode to AHCI mode, you'll have to follow a simple procedure; otherwise your system will refuse to start Windows.

First we'll have to set Windows 8 to boot into Safe Mode. Open an elevated command prompt (type CMD on Windows 8 Start screen, right-click the Command Prompt app and click Run as administrator from the menu (Figure) Run as administrator) and type the following command bcdedit /set {current} safeboot minimal and press [Enter] on your keyboard.

Restart your system, enter your BIOS and change your SATA mode to AHCI. After saving the BIOS changes, restart your system. Windows 8 will boot in SafeMode. Open an elevated command prompt and run the following command to remove the SafeMode boot option: bcdedit /deletevalue {current} safeboot. Restart the computer and boot normally, you should now be running in AHCI mode.

Below you'll see the results of a benchmark I took using AS SDD Benchmark tool.


Standard SATA (IDE Mode) vs. Enhanched SATA (AHCI Mode)

Below I'll explain some changes and/or misconceptions regarding Windows 8 settings and SSD drives.

Defrag

If you are familiar with SSD's you could be aware that the general advice is to always make sure defrag is not running on your SSD drive. Disk defragmentation is unnecessary on an SSD drive and can even have a negative effect on the endurance of the drive.

In Windows 8, you'll notice that defrag is set to run on your SSD drive (Figure) Defrag Settings. Do not switch this off manually!

Samsung Electronics Samsung 840 Series Solid State Drive (SSD) 250 sata 6.0 gb 2.5-Inch*

According to a Microsoft Sr. Program Manager from the Storage and File System Team, Windows 8 (like Windows 7) supports the TRIM command (for details look at the right hand side bar on this page). The NTFS file system will send trim 'hints' when files are deleted or moved; SSDs use these hints to perform a cleanup in the background that helps them get ready for next writes. The SSD may choose to perform the optimization immediately, store the information for later optimization or throw away the hint completely and not use it for optimization since it does not have time to perform this optimization immediately.

In Windows 8, when the Storage Optimizer (the new defrag tool) detects that a volume is mounted on an SSD - it sends a complete set of trim hints for the entire volume again - this is done at idle time and helps to allow for SSDs that were unable to cleanup earlier - a chance to react to these hints and cleanup and optimizer for the best performance. The optimization is set to run once every 28 days.

No traditional defrag (moving files to optimizer there location for space and performance) is performed on SSDs.

One Potential Problem:

There is however one problem with defrag: If you run "Automatic Maintenance" from the Action Center, you will discover that your SSD drive is defragmented! That can't be right. You can see from the screen shot below that my SDD drive was being defragmented. I checked with Intel's SSD Toolbox, and found that this procedure 'cost' just over 20 GB of host writes (when run on my 'old' 120 GB Intel X 25-M drive), while my long term average stands at around 8-10 GB/day.


Testing by several people has revealed that the 'problem' seems to stem from the command that is used to run the scheduled defrag task which lists: defrag.exe -c -h -o -$ (Figure) Scheduled Task for Defrag. The problem is the last (undocumented) parameter $. When you remove this parameter from the task, and then run Automatic Maintenance you'll notice that defrag will only run the TRIM function.

If you want to test this, please note that you would have to start the defrag GUI before removing the parameter. If you try to start defrag after changing the parameter it will refuse to start unless you choose the option Remove customized settings (which indeed puts the $ parameter back at the defrag command).

To work around this issue you have two options: Remove the parameter $ from the defrag command and whenever you need to make changes by using the defrag GUI remember you'll remove the parameter after your changes. The other option would be to disable the scheduled defrag task, and replace it with a new task you create yourself (using the command/parameters defrag.exe -c -h -o).

Now there's one other observation I'd like to add: So far I have seen NO evidence that the Automatic Maintenance will actually run a defrag. I've been watching my SSD drive, and although defrag says that optimization is needed, so far nothing has run on the drive (I'm also looking at the amount of host writes on a daily basis). Automatic Maintenance has run multiple times (Figure) Maintenace, but so far without running defrag on the SSD drive, so for now it looks that only choosing the option to run the Automatic Maintenance manually will trigger a defrag of your SSD drive.

Superfetch

Microsoft made some changes here too. The Superfetch service should be left enabled in Windows 8. When Windows 8 detects it is installed on a SSD drive, it will disable Superfetch by changing/removing a registry setting. But the Superfetch service also runs the Prefetcher function, and this should stay enabled on Windows 8.

Prefetch settings in the Windows 8 registry


The Prefetcher improves Windows boot time. A large number of files need to be read into memory and processed when a Windows system boots. It is not uncommon that different parts of the same file have to be loaded at different times. This would result in a significant amount of time the operating system spent opening and accessing files multiple times, where a single access would be more efficient. The prefetcher records a trace file of activity taking place when windows boots. Future boots can then use the information recorded in this trace file to load code and data in a better fashion.

Myth busting!

Yes, there are a lot of myths surrounding SSD drives. You should realize that most of the "Optimize" tips you'll find can be traced back to first generation SSD drives. These 1st gen drives suffered from all kind of performance problems, both related to the quality (or lack thereof) of their flash memory and the drive controller.

On page 2 of this article I will tackle some of the misguided performance tweaks you'll frequently find posted on the Internet.

« Previous   1   2   3   Next »