Thoughts from the EPS Windows Server Performance Team
Useful Microsoft Blogs
Today we are going to discuss two new Vista performance enhancements, SuperFetch & ReadyBoost. We will also be discussing Vista RAM usage since these all work together.
First, SuperFetch is an enhancement of the Prefetcher that you have probably seen mentioned in previous versions of Windows. The Prefetcher is in charge of storing program information so that often-used programs and processes can run faster. In Vista, the Prefetcher has been tweaked and changed to be much more aggressive and intelligent in its caching to give even greater performance. This new functionality is called SuperFetch.
SuperFetch keeps track of which applications you use most and loads this information in RAM so that programs load faster than they would if the hard disk had to be accessed every time. Windows SuperFetch prioritizes the programs you're currently using over background tasks and adapts to the way you work by tracking the programs you use most often and pre-loading these into memory. With SuperFetch, background tasks still run when the computer is idle. However, when the background task is finished, SuperFetch repopulates system memory with the data you were working with before the background task ran. Now, when you return to your desk, your programs will continue to run as efficiently as they did before you left. It is even smart enough to know what day it is in the event you use different applications more often on certain days.
OK, so how is RAM usage affected? You may have noticed that Vista tends to use a much greater percentage of system RAM than on Windows XP. It is not uncommon to view Task Manager on a Vista machine with several GB of RAM installed and less than 100MB of the RAM shows up as free. For instance, here is a screenshot of Task Manager from the machine I am working on now.
As you can see, this machine has 4gb of RAM and is only using about 2.2gb considering the applications I have open (I'm currently running Outlook 2007, Word 2007, Windows Live Writer Beta, several instances of IE7 with multiple tabs open and some of my day to day tools) however it shows free physical memory of just 59MB. At first glance, this would seem to be something to worry about and this tends to make people a bit nervous, but once you consider the impact of SuperFetch this condition becomes less of a concern.
Many people tend to think of RAM as some sort of resource, and when it starts getting used up, they believe that they have a problem. In reality however, RAM is more like a cache. If your system is only using a small percentage of your cache is a huge waste. Imagine how your processor would work if its L2 cache never used more than 25% of its capacity. L2 cache is a small amount of high-speed memory that allows for high-speed access to the system's most commonly accessed data.
In previous versions of Windows, the Prefetcher wasn’t very aggressive in populating RAM. With Windows Vista however, SuperFetch tries its best to use as much RAM as it can, because if you have it you might as well make use of it.
As you may notice in the screenshot above, it only shows about 2.2GB of RAM used, yet doesn’t show the remainder as free. This is because the data in the cache is considered very low priority and any process that comes in and needs to use RAM will flush this data out transparently to the user or process. So, the memory is being used, but as far as the processes are concerned, it is empty. So what this boils down to is that even if you see that you have very little physical memory free, it is most likely nothing to worry about, it is just SuperFetch working. That having been said, if you have multiple programs that are using lots of RAM, this could still cause system resource depletion, however you would be able to see that in the Memory Usage graph in Task Manager. If you disable SuperFetch, then Windows Vista behaves more like Windows XP in terms of the Prefetcher. SuperFetch also automatically recognizes and uses any capacity afforded by storage devices enhanced for ReadyBoost and ReadyDrive for high-performance disk caching.
Now that we've introduced SuperFetch, let's move on to ReadyBoost. Whenever we talk about ways to improve a computer's performance, one of the first things we think of is adding memory (RAM) to a system. The more memory a system has, the less often it has to access the hard drive to run applications. However, adding RAM to a system is not always a viable option - either because the machine has no capacity for additional expansion, or because RAM itself is not cheap. Remember - it is important to make sure that you understand the difference between SuperFetch performing intelligent caching with available RAM and multiple programs causing resource depletion due to the amount of RAM that they use.
So what does ReadyBoost bring to the table? ReadyBoost is a new feature that allows Windows Vista to use non-volatile memory flash memory such as a USB stick or SD card to improve system performance. Hard drives are great for large sequential I/O. For those situations, ReadyBoost is not used. Handling small disk transactions is much faster on solid state memory when compared to hard disks, however the trade-off is that the continual throughput rate of a USB stick or SD card does not stack up well against a hard disk. ReadyBoost creates a copy of a portion of the disk cache and places it on the flash memory. All pages on the device are backed by a page on disk.
Disk cache is used by the system to cache recently used data. ReadyBoost uses the intelligent memory management of Windows SuperFetch to pick small amounts of data that are slow to get from the hard disk cache and makes a copy of them on the flash drive. It's important to remember that this is only a copy, so even if the stick is unplugged, no data is lost and the system keeps going. The net result is that when the system needs to access small pieces of non-contiguous data, it can get it much faster from the flash drive than the hard disk. If the system needs to access larger chunks of data, it simply uses the hard disk. At this point it is important to point out that we use AES-128 to encrypt everything that we write to the device, so if you remove the device, your data stored on the device is still secured.
OK - so what are the guidelines for using ReadyBoost? Generally, it is recommended to have at least a 1:1 ratio of solid state memory to RAM. So if you have 2GB of RAM, you should have at least a 2GB USB stick or SD card. That would be considered the ideal minimum. At the other end of the spectrum, you could have a 2.5:1 ratio of solid state memory to RAM. However, the upper limit of flash that can be used for ReadyBoost is 4GB (due to the limitations of the FAT32 file system).
So what kind of speed increases are you likely to see? In all honesty - it will vary from system to system. On a machine with only 1GB of RAM that is being used heavily, ReadyBoost will provide a noticeable performance increase. Conversely on a system with 4GB of RAM that is not really being stressed by application usage, the benefits of ReadyBoost will not be readily apparent.
There you have it - a quick introduction to ReadyBoost. The best part of ReadyBoost is that implementing it is easy; all you have to do is plug in a compatible stick and select the "Speed up my system using ReadyBoost" option in the AutoPlay interface. The configuration options of ReadyBoost are very simple - as you can see from the image at left, you have two choices when you plug in your device - whether or not to use ReadyBoost, and how much space on the device to allocate to Ready Boost. For non-technical users, opening up the case of their home systems and adding RAM can be a daunting task, but going down to the local computer store and picking up an inexpensive, compatible USB stick should be easy enough!
Here are the requirements for a ReadyBoost-compatible USB Device:
- Tim Newton
I can report that on my Windows Vista Home Premium computer, I was able to decrease disk thrashing without losing performance by disabling SuperFetch, PreFetch, and ReadyBoost. I think I may have allowed some fetching for boot operations only, if I recall. There is a registry setting for it that I found online somewhere.
Now I'm struggling with finally completely eliminating disk thrashing. It seems like the remaining processes that thrash the disk are related to logging almost exclusively.
It's desirable to eliminate the disk thrashing because I want my hard drive to last longer and also because the disk activity seems to cause errors for my backup program. The backup problem works just fine if there is no disk activity just before running it, but it's very frustrating having to wait 20 minutes for the system to go fully idle before I run the backup program.
My computer is a Gateway GT5622 with two 1.8 GHz cores and 3 GB of RAM. It is heavily tweaked for use as an audio workstation. I needed to disable a lot of services and scheduled tasks as well. Windows XP is much easier to tweak for audio and requires fewer tweaks. I would have downgraded to XP, but the procedure seemed way too complex for me and I wasn't sure that I could find XP drivers for all my hardware.
I have intel i7 920, 1TB 'Black' performance WD 32mb cache drive, 12GB of ram with Vista Ultimate 64.
With superfetch service turned on, I notice a lot of disk activity, even while I'm actively using the computer.
Somehow the caching seems to be hindering disk performance instead of helping because it's reading application to be put into memory.
Also I don't keep my machine on, I turn it off overnight, so this service seems to be a disservice to me because everytime I boot Vista, there's always that heavy disk activities after logging on to the desktop.
I have lots of RAM, I don't mind if superfetch uses it all up, but constant disk trashing while I'm using the computer is a problem.
I have superfetch turned off because it's not needed in a fast machine with lots of memory, the trade off between fast switching application vs heavy disk activity that slows down your overall computing experience is just not worth fast switching.
i use a conroe E6400 with 2GB ram, i'm experiancing same problem with long disk activity after booting to Vista ultimate, the more apps i install the longer i need to wait for this fetching to finish. this is horrible. When i disable superfetch from the services console it won't do much help, vista will continue loading these files as usual no change in disk activity. fetching is now built in the system nothing much to do about it just learn to live with it or rollbk to XP. Win 7 has same problem but lil less time to fetch all it's files.
Windows Vista uses a LOT of resources, and has so much useless background applications running that are never used. Also, if get an HP, you have like 45 or more HP products running too. To me, I don't always use the same applications every time i log on, so i don't really need Superfetch.
I have Vista Home Premium on my laptop. I use a 4gb usb memory stick set for ReadyBoost, all the time. It's great. A couple of times, after hibernating then starting up again, I've forgotten to insert the memory stick before doing so! Ooops!
1 - What does this cause?
2 - What should I do, or not do, upon discovering that I've made this mistake?