Tuning Windows for Maximum Performance

written by: Leon Gualee; article published: year 2006, month 11;



In: Categories » Computers and technology » Microsoft OS family » Tuning Windows for Maximum Performance

In this tutorial you'll learn some specific settings you can make to tune Windows for peak performance. Of course there are always trade-offs to be made, and you'll have to make personal judgments as to whether a feature is worth its cost in computer time, or whether it should be disabled to gain speed, or whether you should spend more money to speed your computer with better hardware, or gain speed through software settings and feature sacrifices.

Installing Sufficient Memory (RAM)

The most important thing you can do to make sure your computer runs at top speed it to make sure that you have enough main memory (RAM) installed. Here's why: Windows uses a system called virtual memory to let applications use as much memory as they want, even if they want to use more memory than the system has available. The shortfall is made up by using space in a hidden disk file called the page file to store data that won't fit into main memory. When a program wants more memory than is currently free, Windows freezes the application, finds a block of memory that hasn't been recently accessed, writes its contents to the page file (pages it out), and then lets the frozen application use this block of memory. When the application whose memory got shuffled off to the disk drive gets its turn to run again, and tries to read or write to the memory block that got taken away, Windows has to repeat the process, shuffling some other application's memory off to disk and paging the first application's data back in.

This decades-old technique lets multiple applications share limited memory, lets an application run even if it needs more memory than the computer has, and it's been made as efficient as possible, but it has a cost: Reading and writing to the hard disk is thousands of times slower than reading or writing data from RAM. Each time Windows has to stop to move memory in or out of the page file, it delays the frozen application by several tens of milliseconds at least, and if this happens several dozen times a second, the application slows to a crawl. There's even a technical term for this: thrashing, which means expending a lot of effort and getting little done. If you ever used Windows 95 or 98 on an old computer with 32MB of memory, you know well what this is like. And even a current computer with 512MB of memory can start thrashing if you load in a big video clip for editing.

The good news is that even while Windows and applications have bloated to the point that they require hundreds of megabytes just to boot up, memory has gotten so cheap that there's virtually (ha!) no reason to suffer with a computer that's having to page data to disk.

How Much Memory Is Enough?

So how much memory is enough? You can actually do some calculations to find out. After going through a demanding work session, type Ctrl+Alt+Del to open the Task Manager, and view the Performance tab. Under the graphs are some numbers the list amounts of memory in K (thousands of bytes). This is what they mean:

  • Physical Memory, Total The amount of RAM you've installed in your computer, less any "borrowed" by a low-end "shared memory" motherboard-based graphics adapter.

  • Physical Memory, System Cache The amount of physical RAM being used just to speed up file operations.

  • Physical Memory, Available The amount of memory that is either totally unused or could be taken away from the System Cache if needed by applications.

  • Commit Charge, Total The amount of virtual memory actually in use by Windows, drivers, services, and applications; in other words, the amount of memory your system thinks it's using at this moment.

  • Commit Charge, Peak The largest Total Commit Charge since Windows was last booted.

  • Commit Charge, Limit The amount of physical memory plus the current size of the page file; this is the most virtual memory that could be in use at once. If necessary, Windows will increase this quantity automatically by enlarging the page file(s), if the page file(s) can be increased in size.

Now, here's how to use these numbers:

  • If the Commit Charge Peak is equal to the Commit Charge Limit, your page file filled up at some point, and either had to be extended, which means it's now fragmented and slowing you down, or it has reached its maximum size, which means you've pushed your computer to the proverbial wall and held it there. Check the page file settings to see whether your total page space is limited in size to this amount. If so, you should increase the limit. You may also want to use a third-party disk defragmenter that is able to defragment your page file. Alternatively, move the page file to a different physical disk drive with more room and less fragmentation.

  • Calculate the approximate amount of "working memory" in your system by calculating (0.9 x Physical Memory Total) Kernel Memory Nonpaged.

  • If this working memory amount is greater than Commit Charge Peak, you have sufficient memory installed in your computer. (Of course, having more wouldn't slow it down any.)

  • If the working memory amount is less than the Commit Peak, calculate the shortfall as Commit Charge Peak working memory. Divide this shortfall amount by 1,024 to get the number of MB that you need to add. You may have to replace your current memory modules or add additional modules, depending on what you have now; Upgrading and Reparing PCs goes into these details.

Here's an example. From my computer, I recorded the following numbers:

Physical Memory Total 1048096
Commit Charge Total 505712
Commit Charge Limit 2520816
Commit Charge Peak 649472
Kernel Memory Nonpaged 19288

The interpretation is:

  • Commit Charge Peak is much less than Commit Charge Limit, so the Page File is currently large enough.

  • Working memory is (0.9 x 1048096) 19288 = 923988KB.

  • 923988 is greater than the Commit Charge Peak of 649472, so there is sufficient RAM.

Now, if my computer had only 512MB (524,288K) of memory installed, the results would have been different:

  • Working memory would be (0.9 x 524288) 19288 = 452571 KB.

  • The working memory would be less than the Commit Charge Peak, with a shortfall of (649472 452571) = 196900KB, or 192MB.

In this case, the indication would be that I would have to add at least 192MB of memory to prevent memory paging from slowing me down. You can live with some paging, of course, but it definitely drags performance down. This is why, despite Microsoft's recommendation of a 256MB minimum, 512MB is a functional minimum memory size for Windows XP.

Placing the Page File

If the preceding calculation shows that you need to increase the size of your page file, consider where you should put the page file for best performance. Paging needs to be as fast as possible. You can configure Windows to put page files on more than one drive, and you can set maximum and minimum page file sizes or let Windows manage the size automatically. Here are the things you should consider to make the most efficient page file setup:

  • Your total page file size should be 1.5 to 3 times the amount of physical memory in your computer; tending toward the smaller factor if you are sure you have adequate physical RAM, and toward the larger if you know you don't. Don't allocate less than 512MB of page file space.

  • If Windows is reading or writing to the page file, it means that some application, or Windows itself, is frozen and waiting for the disk operation to complete. Reading and writing data to and from disk is slow enough, but having to mechanically reposition the little recording head that swings back and forth across the disk surface is even slower, thus costlier. Therefore, you don't want your page file to get fragmented, forcing Windows to move the recording head all over the disk to pick up the scattered data. As soon as you install Windows, set a very large minimum page file size, 2 or 3 times the amount of physical memory in your computer, so that this block is allocated all in one piece.

  • If your page file grows during normal operation, the Windows Defragmenter can't put the pieces back together. Only third-party applications like Diskkeeper can do this.

  • The best place to put a page file is on a fast disk drive that is physically separate from your primary Windows disk drive, preferably one used only occasionally for other purposes. This way, the disk's read head will be positioned once and left in the location of the page file. The disk drive should be an internal SATA drive, internal or external fast SCSI drive, or an IDE drive not on the same controller cable as a CD-ROM or DVD drive.

  • The second best place to put a page file is on the same drive as Windows.

  • The worst place to put a page file is in a separate partition on the same physical disk as your Windows drive. In this case, the disk's read head has to travel a large distance every time it needs to switch between the page file and an operating system file.

  • If you have several otherwise equally desirable choices, dig into the specifications for the disk drives involved, and place your page file on the disk with the lowest track-to-track positioning time and the highest data transfer rate.

Defragment the Disk

Another key factor in achieving top performance is the speed at which data can be moved between your computer's CPU and its hard disk. Having the latest high-speed disk interface hardware won't help you if your files and data are widely scattered across the disk. Disk data gets scattered, or fragmented, over time, and to maintain peak disk performance, you should periodically run a disk defragmenting utility.

Windows XP comes with a defragmenting tool. However, it's not the sharpest knife in the drawer, so to speak, and you can get much better disk performance improvements if you buy a better "defragger" and run it on a regular schedule. Check out Raxco's PerfectDisk (www.raxco.com) and Diskeeper Corporation's Diskeeper (www.diskeeper.com, with just one k).


Note

To help Windows XP meet its goal of keeping its boot time under 30 seconds, there is a special service that automatically runs every few weeks or so, which identifies the files Windows uses when it boots, and reorganizes them on the disk so that they're placed in the order in which they're used, in consecutive unfragmented disk blocks. This helps reduce boot time but doesn't speed up subsequent disk operations.

Disk Interface Tuning

Having data neatly organized on disk won't help if the pipeline between the disk and the CPU is restricted. Hard drives can achieve the highest transfer rates if they transfer data directly into the memory on your motherboard using Direct Memory Access (DMA), but they can be prevented from doing this if they share a controller cable with a slower Zip Disk, optical, or other ATA disk device. To verify that your disk drives are using DMA transfers, log on as a Computer Administrator, right-click My Computer and select Manage, and open the Device Manager. Select View, Devices by Connection and locate the entries for any IDE-type disk controllers. You will have to open the items in the tree view to find them

Find the channel entry that connects to your Windows hard drive, such as "Primary IDE Channel"; double-click it and select the Advanced Settings tab, shown in Figure 6.30, and examine the Current Transfer Mode for each device. Disk devices should be using a DMA mode, not Programmed I/O (PIO), which requires the CPU to intervene in transferring every byte to and from the device. Higher DMA transfer modes are faster. Transfer modes and rates for standard parallel ATA devices are listed below. If a disk is listed as using a mode that is slower than the disk drive's peak transfer rate, you may have incorrectly arranged or cabled disks, or an inadequate disk controller.
IDE Disk Transfer Modes and Rates

Mode

Also called

Maximum Transfer Rate, MBps

Ultra DMA Mode 6 UDMA/133 or Ultra ATA/133 133
Ultra DMA Mode 5 UDMA/100 or Ultra ATA/100 100
Ultra DMA Mode 4 UDMA/66 or Ultra ATA/66 67
Ultra DMA Mode 3   44
Ultra DMA Mode 2 UDMA/33 33
Ultra DMA Mode 1   25
Ultra DMA Mode 0   16.7
DMA Mode 2 Multiword DMA mode 2 16.7
DMA Mode 1 Multiword DMA mode 1 13.3
DMA Mode 0 Multiword DMA mode 0 4.2
PIO Mode 4   16.7
PIO Mode 3   11.1
PIO Mode 2   8.3
PIO Mode 1   5.2
PIO Mode 0   3.3


Repeat this check for any other channels that connect to hard drives. If DMA transfers are prevented by a slower device on the same channel as a disk, you may want to reconfigure the hardware so that slower devices are on a separate channel.

What to Enable and Disable

You can disable some Windows services and graphical functionality to gain additional performance. There aren't many such items that make the trade-off worthwhile, but we'll cover a few of them here.

Graphical Niceties

You can make Windows' responses to menu operations somewhat snappier by disabling some of the shading, shadows, and smooth scrolling features that have crept into the Windows user interface. You can see a list of optional graphical effects in the Display Properties dialog, Settings tab, and Effects button, and the TweakUI PowerToy also has check boxes that you can use to disable graphics effects.

On my computer, I've disabled the fade-in of pop-up submenus, which occasionally seems to take more time than I would like it to, and font smoothing, which I personally don't like.

Unnecessary Services

You can eke out some small gains in performance by disabling system services that aren't necessary. This will decrease the time it takes Windows to boot, will free some memory (usually not enough to have been worried about), and will prevent these services from running and taking CPU cycles away from your interactive work. The only truly egregious CPU and disk hog in the Services list is the Indexing service. If you don't use the search for keywords within files option in the standard Windows Search utility, or if you use a more advanced search tool like Google Desktop Search instead, you can disable the Indexing service using the Services management utility.

If you do need to use the Indexing service because you use search functions in web pages hosted by Internet Information Services on your computer, you can restrict Indexing Service so that it searches only web content and not your entire disk. As a Computer Administrator, open the Computer Management window, open the Indexing service entry under Services and Applications, and dig down to System, Directories. Delete the entry for C:\ and for any other drive root folders. This will prevent the indexing of your disks for general searches. Leave the other entries, and all entries under the web branch, alone.

If you installed the Internet Information Services (IIS) web server suite out of curiosity but don't use it, this is another candidate to be disabled.

legal disclaimer

1) Our website is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringements, please read the Terms of service and contact us to investigate the problem.
2) The E-articles directory team is not responsible for inaccuracies, falsehoods, or any other types of misinformation this tutorial may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. Please read the Terms of service

Useful tools and features

Translate this article to...    Send this article to you or to a friend

Link to this article from your page   
If you like this article (tutorial), please link to it from your web page using the information above. Linking to this page, this is the only way to help us improve our service, the same time providing your visitors with a way to improve their online experience.

related articles

1. How to Configure Automatic Updates in Windows XP
Automatic Updates is a mechanism with an awkwardly plural-sounding name by which Microsoft or corporate network managers distribute critical security updates to Windows users. Fixes sent by this means are considered so important for adequate security in the hostile Internet environment that Microsoft prefers that you configure it to download and install the updates, and if necessary even restart your computer without your being aware of it. There are four levels of Automatic Updates protection to which you can subscribe:...

2. MS DOS Versus PC DOS
With modern PCs having a very high level of standardization and compatibility, today it is easy to see how Microsoft can market complete packaged operating systems that will install and work unmodified on practically any PC you can purchase or build. Without the standardization and compatibility we have come to depend on, different specific "flavors" of a given operating system would be required for specific different hardware. That is exactly how things were back in the early '80s when the IBM PC was introduced. Many o...

3. How to make your PC Available for Remote Desktop Connection
To use Remote Desktop to reach your computer from the Internet, both the computer and your Internet connection must always be up and running. In addition, you must be able to make connections from the outside world to your computer, so there are additional requirements: If you use dial-up Internet service, you'll need someone at home to establish the connection before you can connect to your computer. If you use cable or DSL Internet service, you must either have a static IP address ass...

4. How to Update DirectX ~ Advantages
Although most Windows applications place fairly low demands on the display system, putting up fairly static displays and updating them relatively infrequently, interactive games and video displays are very graphics intensive. Game players pay big bucks for fps, or frames per second, which is a measure of how fast the hardware and software can generate new images as the scene changes and objects move. Under about 30fps, the image flickers and motion is noticeably jerky. Beyond 30fps, faster updates aren't noticeable, and the e...

5. Using Simple File Sharing in Windows
Although most home users are typically happy letting anyone at any computer read or modify any file, business users need to restrict access to files with payroll, personnel, and proprietary information. Windows XP and its predecessors, Windows NT and Windows 2000, were primarily designed for business use, so they require usernames and passwords for identification, and have a security system that lets computer owners restrict access to sensitive files on a user-by-user and file-by-file basis on each computer. Unfortunate...

6. The Evolution of Microsoft Windows ~ The Windows 9x Family
By the mid-1990s, processor power had increased and memory prices had decreased dramatically since Windows' original release. The Internet had also sprung onto the world stage, from an academic tool to an instrument of global communication and commerce. (You may recall that Windows 3.1 did not even include support for the TCP/IP network protocol used on the Internetyou had to purchase it from a third-party vendor.) Users' expectations likewise had grown with computers' capabilities, and desktop publishing, graphics editing, and...

7. How to install Windows and Installation Types
Deciding on the type of installation to perform is dictated by many factors, such as the following: Is there an operating system currently installed? If so, do you want to preserve settings and configurations, or start from scratch? Will the installation be performed interactively or remotely? How many computers are to be installed at a single time? Is your network arranged in a domain model using Active Directory? These are ...

8. How to adjust Text Icons and Window Element Sizes
If you find the items on the screen difficult to read or see, you can either lower the screen resolution, which makes everything larger but blurrier, or ask Windows to make the elements themselves larger while keeping a crisper, high screen resolution. There are two ways you can do this. Here's the first procedure: 1. Right-click the Desktop and select Properties. 2. Save the current screen settings so if you're unhappy with the results, you can back the changes out. Select the Themes tab, click Save As, and enter ...

9. DOS Versions
Let's take a look at the actual nuts and bolts that constituted each version of DOS. DOS 1.x PC DOS 1.0 was introduced along with the IBM PC on August 12, 1981, and supported only single-sided 5.25-inch drives. Floppy disks were formatted using 8 sectors per track (one side, 40 tracks) resulting in a capacity of only 160KB when formatted. There was no support for hard disks at all, which were generally quite rare for personal computers at the time. DOS was a text-based operating system, hence there was no graphi...