Windows 2000 Hard Drive / Memory Tweak Guide
Posted: May 26, 2000
Written by: Keith "Farrel" McClellan

Introduction

Hard drive and memory tweaks are by far the most abundant type in the most recent release of Microsoft's business oriented OS. This is mainly because Windows 2000 is designed with performance in mind. This performance, however, is specifically aimed at a networking environment and as such includes many features that aren't needed unless you are running a networking server. So, in this guide, we are going to axe all of those extra processes, as well as enabling a few other tweaks to enhance performance.

Before we get into that, however, I'd like to give mad props to the guys over at Ars Technica for their pioneering work on tweaking Windows NT 4.0. Their tweaks gave me an excellent springboard for this particular tweak guide, and honestly, I'm not sure if I would have known where to start without their info. I’d also like to point out that several of these tweaks won’t function properly unless you are in Administrator mode when implementing them – so log back in as the Admin already, would you?

Write Behind Caching

This is a simple setting that needs to be enabled for each individual hard drive in your system. As the name implies, this setting tells the computer to cache all of the disk writing operations to that particular drive. Basically, this means that a certain amount of what is being written to the disk is actually being stored in the RAM and isn't written to the disk until either the cache starts overflowing (in which case it starts writing from the bottom of the cache) or the computer is shut down. While enabling this setting increases performance significantly, it is important to mention that if your computer isn't shut down properly, there is a chance that the information isn't properly written to the disk, in which case it will be lost. This really isn't a big deal on your average desktop, but if you are running an important server and you don't have a UPS, it might be a problem.

To enable write caching, go into the Device Manager (it is a new feature for the NT code base, but Win9x users should be familiar with it) and select the properties for the disk you want to enable the feature on. Go to the disk properties tab and enable the setting, and then restart your computer at your leisure.

Direct Memory Access

DMA, in all of its flavors, is vastly superior to the PIO data transfer method to which most computers default. For those of you who are not familiar with DMA and what is does, DMA (or UDMA) is the process in which a hard drive can transfer data directly to the system RAM with minimal involvement of the processor. When the computer is using the standard PIO mode, the processor has to direct the hard drive's every move, which is detrimental to performance.





Direct Memory Access Continued...

One of the nice features of Win2k is that you can enable DMA without any of the problems inherent to installing it on the Win9x platform. Why is that? It is because the system will dynamically check for compatibility if you set it to do so, rather than forcing the setting upon an incompatible hard drive. To enable DMA, you will need to once again get access to the Device Manager. Scan down to your IDE controller and select the Primary IDE channel. Go to the advanced settings tab. For each device, set its device type to Auto Detection, and its transfer mode to DMA if available (this works for your CD-ROM as well). Repeat the process for the Secondary IDE channel and then reboot. You should see a very nice performance boost.

Enabling UDMA/66

However, even after you have enabled DMA on your IDE channels, UDMA/66 is still disabled by default in Win2k. To enable it, it is necessary to play around with the registry a bit. If you would like to perform the operation manually, you can do it by browsing to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\0000 key and adding a new DWORD value called EnableUDMA66. Set the value to 1 to enable UDMA/66 or to 0 to disable UDMA/66. Or you can use the following registry files [Enable UDMA/66 | Disable UDMA/66].

Disk Defragmentation

Finally, Microsoft saw fit to include a defrag tool (which is actually a modified version of the Diskeeper Lite program) along with Windows 2000. I've got one piece of advice for you -- use it, and use it often. Okay, so maybe that's two pieces of advice. The included defragmenter is notoriously slow, however, so be prepared to run it overnight. If you've got the extra cash to spare, and want as great a performance increase as possible, go for a program like Diskeeper. It will not only defragment your files, but it will also reorganize them and defragment your pagefile as well – oh, and did I mention that you can set it to run on time intervals, dynamically in the background, or on startup as well?

NTFS vs. FAT32

Both NTFS and FAT32 have their strengths and weaknesses. NTFS is a secure file system and is generally faster than FAT32 under Win2k on larger file partitions. However, unlike NTFS, FAT32 is compatible with Win9x as well and is plenty fast on smaller drives. My recommendation would be to use NTFS if you are only running Windows 2000 on your computer, but if you are dual-booting with Win9x or Linux, you have to have at least one of your partitions set to FAT32. If you are a real speed phreak, you could put your Win2k system files and pagefile on an NTFS partition (a small one), and all of your data files on a FAT32 partition for sharing between all of your OSes. Of course, if you do that, you can’t share paging files between OSes – but that’s another issue.

Pagefile Tweaking

The pagefile in Win2K isn't dynamic like the swapfile in Win9x, so it is even more important to optimize your virtual memory settings for this OS than it ever was for Win9x. With that said, there are a few guidelines you should follow when optimizing your virtual memory.

- Unlike Win9x, you can split your pagefile over several hard drives. It generally isn't recommended to split up your pagefile over separate partitions, but if you have two similar speed hard drives (you could use a 5400 and a 7200 rpm drive together, but you would want to stay away from a jump of more than about 2000 rpm), splitting your pagefile over the two drives is a great way to improve performance.
- Your pagefile should almost always be larger than your system memory. If you have less than 96 MB of ram, I recommend having at least 1.5 times your physical ram size in your pagefile, and you might even benefit from 2x. If you have between 96 and 256 MB of RAM, the Microsoft recommendation of RAM +30 MB appears to work well -- but if you are at the lower range of that spectrum and do a lot of multitasking you might benefit from a setting like 1.5x RAM. If you have 256 MB of RAM, you probably only need 256 MB of swapfile space. Unless you have your computer set to full dump in case of crash mode, any more would be a waste.

To set your pagefile, go into the advanced tab of the System applet and click on the Performance Options button. At the bottom of the dialogue box that pops up, there will be a button that says change. Click that to go into the Virtual Memory screen. From within this sub-applet you can set your virtual memory settings, and Windows even gives its own recommendation for pagefile size.

Pagefile Sharing

I first discussed this in my Win9x/Win2k dual booting guide, but I figure that it fits in equally well here so I am going to include it. Pagefile.sys and win386.swp, other than the file names, are virtually identical and there is no reason to not share a single swapfile between both Win2k and Win9x (you can share it with other OSes as well, but these are the most commonly dual booted OSes, so…). There are two ways of doing it – you can change Win2k to use the Win9x swapfile (pretty difficult but in some ways more convenient because you have to install Win9x first anyway), or you can change Win9x to use the Win2k pagefile.

To force Win2k to use the Win9x swapfile you will need to modify the key [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Memory Management]. We will be modifying the PagingFiles value.

Before you continue on with this tweak, I recommend you go back and export a copy of that key as it currently exists, because it is impossible for me to create an undo key for this operation.





Pagefile Sharing Continued...

Now, you can either choose to edit the value manually or use one of my pre-defined defaults. To edit the value manually, right click on the value and select Modify. You will want to modify the letters/numbers on the far right – they will automatically change the hex values to the left for you. Just be careful to leave those dots in between each character (be careful not to delete them – I haven’t yet figured out how to type them using the keyboard – they are different than regular periods). If you are going to be less brave, here are the default registry files for 128, 192, and 256 MB of virtual memory for both the C and D drives.

C Drive: 128 MB; 192 MB; 256 MB
D Drive: 128 MB; 192 MB; 256 MB

After changing the registry setting reboot into Win2k and log on to an administrator account. Then go ahead and delete pagefile.sys from your root directory – there should be a warning of some sort about deleting the file. Ignore it and delete it anyway, and then reboot again. Check and see if the file was recreated – if it wasn’t, you are in the clear.

To change the name and directory of the swapfile in Win9x so it uses the Win2k pagefile, you need to go into the system.ini file and insert the following lines underneath the [386Enh] section:

PagingFile=z:\pagefile.sys
PagingDrive=z:

Where z: is the drive on which your pagefile resides (ex: c: or d:). After changing the setting make sure that the permanent swap file size settings for Windows are identical to the ones being used by Win2k (you can either do that from within the system.ini file or using the system applet in the control panel) and reboot Win9x and delete win386.swp. Yes, this is much easier than the previous method. Why do I include both methods? Because choices are important!

Other Performance Options

Within the Performance Options section of the system applet, there is a setting called Application response. There are two possible values for this setting. The Optimize Performance for Applications setting devotes an uneven amount of processor power to the foreground application (effectively upping the program's priority by one or two steps) at the cost of background performance. This setting is generally optimal for most users. If you, however, are commonly running a server of some sort or have other important programs crunching numbers in the background, Optimizing this setting for Background services would be advisable. This setting equally distributes processor time between all of the programs of the same priority setting no matter what is currently in the foreground.

Priority, for those of you not familiar with this term, is how the computer determines which programs should get processor time, and how much to give each one. There are six basic priority settings (although in the background it is much more complicated and tiered): Real time, High, Above Normal, Normal, Below Normal, and Low. Real time is actually something of a misnomer, and is should really be called Extra High because of the way the computer manages priority settings – and certain, special functions of the OS will receive a ‘higher than real time’ priority rating.

Other Performance Options Continued...

Jeff, a very ‘patient’ reader, was kind enough to spend a great deal of time helping me get some of the kinks out of this guide, and sent me this table to illustrate this point and explain some of the background elements to priority settings:

Priority Class
Real-Time      High  Normal    Idle
Thread  Time Critical      31 15 15 15
Priority Highest    26 15 10 6
Above Normal       25 14 9 5
Normal    24 13 8 4
Below Normal       23 12 7 3
Lowest   22 11 6 2
Idle               16 1 1 1


It also should be mentioned that many times, when a user attempts to set a program to the real time priority they will fail and the program will be defaulted to the high priority class because the program is lacking a special security token allowing it to run at the real time priority class.

Registry Settings

Win2K is a really easy operating system to kill. In fact, it is actually easier to trash an install of a WinNT-based OS than it is to trash a Win9x-based OS, even with the added stability of WinNT. There are a variety of reasons for this that I won't go into here, but before you continue on with your tweaking (editing registry settings and fooling around with system services), make sure you have an Emergency Disk made and a copy of your registry backed up on your hard drive.

If you would like to modify any of the following registry settings by hand as opposed to using the supplied registry files, they can all be found under the HKLM/System/CurrentControlSet/Control/Session Manager/Memory Management key. To use the registry files, right click on the link and select open, and then agree with the dialogue box that asks you if you want to add this information to the registry.

ClearPageFileAtShutdown – This setting is a security setting that clears and overwrites the pagefile on your computer during shutdown. This setting will not change the performance of your computer but it will slow the shutdown procedure a bit. However, if you are paranoid about security, this is definitely something to enable. Enable the setting with this registry file or disable the setting with this one.

DisablePagingExecutive -- When enabled, this will disable paging the NT Executive files to the hard disk and force them to remain resident in the RAM. Enabling this setting will increase overall system performance, but it is only recommended for people with 128 MB of RAM or more because of the load that it puts on your system RAM. Enable this setting with this registry file or disable it with this one.

IOPageLockLimit -- This is one tweak that you may or may not get anything out of because it has high volume IO file systems in mind. If your computer has a lot of IO traffic it could definitely boost performance substantially. I personally don't recommend you even attempt this tweak unless you have at least 128 MB of RAM, but I will be including 1, 2, and 4 MB registry files for you to play with anyway. Most users will find that they will get significant performance increases with a setting between 8 and 16 MB assuming they have 128 MB of RAM. Systems with even more RAM than that may receive a performance increase with an even higher setting. Windows defaults this setting to 512KB, or 0.5MB.





Registry Settings Continued...

Get your 1MB, 2MB, 4MB, 8MB, 16MB, 24MB, and 32MB registry files here, or return the setting to its default with this file.Note that changing this setting can cause problems with some SCSI devices and other system services (some people have reported problems with OpenGL after applying this tweak), so you might want to keep the default setting registry file on your HD just in case. If you aren’t ready to give up on this tweak just because of a few errors and want to see if you can get them running without errors anyway, you could try multiplying the value you are entering into the registry by 1024 (effectively converting the value from Kilobytes to Bytes) – this may fix your problem.

LargeSystemCache – Enabling this setting puts as much of your OS (kernel) in memory at one time as possible. The important thing to remember about this setting is that it is a different system cache from the file system cache (vcache) in Win9x – it is actually a cache for your system files. Setting this up gives the kernel all of the extra RAM (minus about 4 MB) that isn't being used by the rest of the system for active file pages (active file pages being the portions of memory being used by other programs running on your system at the same time). Enable the setting with this registry file, or disable it with this one.

Services

There are many more default system services in Windows 2000 than there were in NT 4.0. For those of you who are not aware of what a system service is, it is sort of like a program that controls a function or functions of the operating system like networking, printers, etc. This allows you to tailor-fit your computer exactly to what you use it for. Disabling certain services can speed boot time and lower your system's overhead. It will, however, limit the capabilities of your computer in the area in which the service is disabled, so think of it as a kind of a trade-off.

There are three different settings for each system service. Automatic sets the service to turn on whenever the computer is booted, Manual only turns on the service if it is called for by another service or a program running on your system, and Disable will stop the service from being loaded entirely. When I refer to disabling a system service, I mean that you should set it to manual. Setting a service to manual doesn't create any overhead, and it allows your computer to access it if need be.

Windows 2000 does a much better job managing initial service enabling than Windows NT 4.0 did. And while there is still less to tweak in this section than there ever would have been under NT 4.0, you can still shave a good 10 MB off of your initial overhead. Yes, I said 10 MB. In this section I will, at this time, only be covering a few of the system services. Windows 2000 related 'tomes' (such as the books put out by QUE and Cybex -- my source for this information is QUE's WinNT 4.0 Workstation manual) are not yet available in Malaysia and as such I will have to stick to what I know about NT 4.0 services for the time being. To get to the services applet, it is under administrative tools in the control panel.

Services Continued...

Alerter -- This service handles administrative alerts, such as ones that are sent out over a network when system failures occur. Unless you are connected to a network and have a network administrator, it is likely that you can set this service to manual.

Clipbook Server -- This service allows other users over your network to view your clipbook. It is strongly recommended that you set this service to manual and use another program for distributing information over your network.

Computer Browser -- This service controls network neighborhood and some other related networking functions. Unless you are not on a LAN at all, I would advice leaving this set to Automatic.

Event Log -- Pretty self explanatory, this service controls your... event logs! Unless you could care less about being able to figure out what's wrong with your system, I'd recommend leaving this one set to Automatic.

Messenger -- Sends and receives messages over a network. If you disabled Alerter, you can safely set this one to Manual.

Net Logon -- Handles certain network security features such as login information. You are most likely going to want to set this to Manual.

Network DDE and Network DDE DSDM -- these two services handle DDE (dynamic data exchange). Unless you collaborate using Office over your network, you will probably want to se this to Manual. Note: that is different from using Office in a normal business setting -- if you need DDE, you'll know.

NT LM Security Support -- Provides security over a few types of NT networking applications. It is recommended that you set this to manual.

Plug and Play -- Enables Win9x-like Plug and Play support to Win2k. Set this to automatic unless you really love messing with internal system registers.

Protected Storage -- this handles secure information like encrypted credit card numbers and the like. Unless you don't store any private information on your computer, leave this set to automatic.

RPC Services -- There are two of these, and they handle RCP name calls. I am really not sure which networking programs use these services, but most likely you won't suffer by setting these to manual. If you find that they are starting up on you anyway, you can set them to automatic.

Server -- This manages file and print services over your network. Unless you aren't on a network, you should probably leave this set to automatic.

Spooler -- This manages your printers. Unless you don't have a printer connected to your computer at all, you will want to set this to automatic.

Task Scheduler -- This schedules weekly defrags and the like. Unless you are too lazy to start that kind of stuff up on your own, you can probably set this one to Manual.

Uninterruptible Power Supply -- This service manages your UPS -- if you don't have one, set it to manual or disable it entirely.





Even More Services...

Workstation -- This handles all of the rest of your networking functions (ones that aren't covered by other services anyway). Unless you don't even have the Internet (which is very unlikely unless someone printed this guide out for you -- tsk tsk), leave this puppy enabled.

There are a ton of other services that come with Windows 2000 by default, but the majority of them are set to Manual for most configurations. However, as I get more information on Win2k services, I'll be sure to update this section of the guide.

Disabling Startup Programs

Windows 2000 doesn't include a way to remove programs started by the registry like Win98 does with the System Information program. However, if you want to do it manually, you can browse to the HLKM\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN key and manually delete the values that are loading the program from there. I would recommend exporting the values that you intend on deleting before deleting them in case you need to reinstall them at a later time.

’Defragmenting’ your RAM

Some very serious questions have been raised as to the validity of this particular ‘tweak’ within Windows 2000 and whether or not it is necessary, or even good, for your system. The whole issue is as follows: while Windows 2000 uses the same 4k pages that are used within the system memory of Win9x to organize information in memory, it actually manages them properly (by paging the unused pages out to Virtual Memory when they aren’t in use) and as such ‘defragmenting’ (which is a misnomer and should actually be called Garbage Collection or Heap Compaction and ‘should’ be a function of a good OS) is an unnecessary operation because it is already being done by the OS dynamically.

Also, because of the way the operation is performed (the actual effect of running the program is a flushing of the physical memory – it basically copies all of the data to pagefile and forces the computer to reload it as it is needed), it actually forces good information out of physical memory as well – so not only is there no benefit to it, it can also temporarily decrease the speed of your system as the computer reloads the information into RAM.

However, no real damage can be done to your system by performing this operation, so I am going to leave the information on implementing it in this guide for the time being. While I am pretty sure at this point that performing this isn’t really going to improve the speed of your system, the whole situation may be similar to the ‘rebooting’ situation. While Win2k isn’t designed to ever really have to be rebooted unless you change settings, it is often observed by network administrators that doing so on a daily basis can improve performance and stability. What I am wondering is if this might be a similar case (as it has the similar effect of clearing out the memory), and as such more input would be appreciated. Either way, at this point, I am not promoting this tweak and it is definitely ‘experimental’ – at least in respect to its effectiveness.

'Defragmenting' Your RAM Continued...

You can use the same Visual Basic trick to perform this operation in Win2k as you could in Win9x. Open up a text file and insert ONE of the following lines:

Mystring = Space(16000000)

-or-

Mystring = Space(80000000)

You only need one of the lines. Save the file as memory.vbs. You can run the program at any time by double-clicking it assuming you have the Visual Basic 4 (or higher) runtime files installed (they are installed by default by Windows 2000, so no worries). The bottom line is for you guys with at least 128 MB of RAM. Everyone should try it first though because it works better most of the time. However, if it causes errors for you, switch to the top line, which should work on any computer with at least 32 MB of RAM. It is also recommended that you close all other programs before you run this.

If you would prefer to use a precompiled program, however, a reader of ours sent in two compiled versions of the Visual Basic program, one for people with people with less than 128 MB of RAM and one for people with at least 128 MB of RAM. You can get a brief description on how to use the program from this page, or you can download the two versions of the program directly [Ramfree32 / Ramfree128].

Conclusion

Tweaking your hard drive and memory settings from within Win2k is quite a bit more complicated than it is from within Win9x, but inevitably it is also more rewarding as well. Hopefully, this Win2k guide has helped you squeeze every last bit of performance out of your computer. It is important to remember, however, that ‘old’ Windows NT 4.0 tweaks, with a little modification, should be able to be used on your Win2k box as well (I think I’ve covered most of the hard drive and memory related ones in this guide, but I’m not absolutely positive of that) - so keep an eye out for them. If you have any comments or questions about this guide, feel free to email me.

Want to return to the normal guide? Click here!

All Content Copyright ©Dan Kennedy; 1998-2000