2K/XP Optimized Machine Guide

advertisement
2K/XP Optimized Machine Guide
Unknown to many, one of the keys to a scorching installation of Windows XP or 2000 comes during the installation
process. While this section will not walk you through building an OS load on your PC from scratch, it will point out
some very important steps to follow if you want to squeeze more juice from that old lemon. You may be asking 'How
do I know if I should reload this puppy or skip on to the next sections?' There are a few scenarios:
1. Using a vendor supplied PC (such as Dell or Gateway), which are pre-loaded at the factory. These are typically
loaded up with so much extraneous garbage that it makes sense to clean them off via a format rather than
uninstalls.
2. Using a PC that has not been ever tuned up or was configured by hitting 'next next next'.
3. You feel like an adventure.
File Structure
When setting up your PC, the choice of file system is critical. Windows 2000 and XP support converting from
FAT16/32 to NTFS, but fail to mention a fatal flaw: drives converted from one file system type to another maintain
the old file system's cluster sizes. The older FAT methods use a default (and very inefficient) cluster size of 512
bytes. NTFS uses a much larger 4K size, which leads to fewer reads/writes from your drive heads as data is pulled off
or written the disk. It is very important to choose NTFS from the get-go during install. Additionally, NTFS is a much
safer, more robust, and easier repaired file system than any other type compatible with Windows.
OS vs. APP drives
Use two separate physical disks if at all possible. - Installing the OS on one disk and your applications/data/pagefile
on another will go a long way towards keeping performance peaked. This is done easily during an install, but is kind
of hard after the fact. Using this system requires self-discipline - it means not just tooling on the 'default setup'
button every time you install software, but instead taking the time to use 'custom' and keep high use applications off
the OS volume on your other disk.
Pagefile
The configuration of the pagefile is most critical during setup (unless you want to go shell out for products like
Partition Magic). After you have just finished the setup portion of Windows 2000 or XP, the pagefile is set with MS
defaults (variably sized, usually set to range from the amount of your physical RAM to about 1.5 times it). A pagefile
should always be set to a static assigned size right after installing the OS. This ensures less internal fragmentation
and being written closer to the high-RPM interior disk clusters. To do this:
1. Open Control Panel
2. Open System
3. Open Advanced Tab
4. Open Performance button
5. Under Virtual Memory, click Change
A. If only one big volume (such as 'C') then change the value to 2.5x your physical memory for both minimum and
maximum. Be sure to choose 'SET'.
B. If using 2 separate physical disks (such as 'C' and 'D') then change the location of the page file to the disk that
does not contain the operating system.
6. Reboot
Early Defrag
Once your OS is finished being setup and the pagefile moved, use the Defrag utility immediately, before adding any
other apps. This will guarantee that everything important is kept tightly packed early on, before application start to
creep in and cause the disk to become more and more fragmented, along with the OS. The installation is supposed
to do this automatically as part of the installation, but a quick analysis will usually show a lot of red.
FAT16 PageFile (New! 12/15/01)
The swap file is incredibly important to maintain properly for best Nt-based system performance. No matter how
much RAM you, the OS loves to drop pages to the hard drive as often as possible. The key is to make that swap area
haul arse. This process is often only possible at the loading of a system, as you haven't already built your drive
partitions. If you're not worried about intensely locked down security, using a small FAT16 partition will help you in
your swap optimization quest:
1. During initial setup, leave an amount of disk space free to equal at least 3x your physical RAM. So, if you have
256MB, leave 768 unformatted.
2. After finishing with your base install (i.e. CD no longer required and OS is booting up for first time), Run Disk
Manager (right-click My Computer | Manage | Storage | Disk Management).
3. Create an Extended partition (not a primary) in the space you left unallocated during your build.
4. Format the space as FAT16 (Not FAT32 or NTFS). FAT16 is the fastest format for Windows-based computing; the
problem is that it is less efficient on disk space and doesn't have the security of NTFS.
5. Assign a drive letter (defaults to next available)
6. Close the Manage applet.
7. Now that partition is ready, navigate to Control Panel | System | Advanced | Performance | Performance Options |
Change.
8. Create a new page file on your new partition, making sure to set the min and max sizes 2.5 times your physical
memory. Be sure to 'SET'.
9. Remove your old pagefile, or shrink it way down to 2MB if you want to be able to have crash mini-dumps written
out.
10. Reboot.
Defaults are at fault
As with any Microsoft Operating System, there are always a number of things that can be easily reconfigured or
disabled to regain PC resources. Large pieces for the OS are automatically configured during setup based on factory
defaults for circumstances that home users typically don't have. Making changes in this will usually make a noticeable
difference in performance, and does not bring the risks of direct registry manipulation.
Service packs and Hotfixes
Always an adventure in the business world, Microsoft Service Packs are extremely important; not only do they fix well
publicized bugs and security holes (*cough* Code Red Worm *cough*), but they also add large numbers of
performance fixes, updated drivers, and other changes that generally help a machine run faster. Service Pack 2 is the
current release for Windows 2000; XP is too new to have any fixes yet, but when the first one releases it will be a
doozy. Additionally, there are always a large number of hotfxes available - these are what will make up the next
service pack. All of these can be found at http://www.microsoft.com/windows
Drivers
After the installation of a PC, many of the hardware drivers installed are Microsoft reference code. Using vendor
drivers may allow extra performance to be squeezed out of a machine, but there are caveats. Some vendor drivers
are written slower, less efficient, or even less stable than those included with a Microsoft OS install. The difference is
in the testing - MS uses thousands of testers and millions of man hours to test drivers before stamping them MS
certified and releasing them to the public; hardware manufacturers typically do not have these resources. The key is
figuring which to use is testing.
1. Use a benchmarking utility (such as those provided by the excellent http://www.spec.org/gpc/) to get a baseline
with your existing MS drivers.
2. Download and install the vendor's latest driver for a given device.
3. Rerun the benchmarks.
4. Compare the results to see performance differences. Don't always assume a vendor driver is better!
5. If you decide how to keep the vendor driver, be sure to note down the now defunct MS driver; if you begin to
experience more frequent crashes, it might be better to switch back to the more stable MS drivers (and be sure to
alert the vendor of the bug!).
Disk Defrag
Defragmentation is the number one thing that can be done to ensure fast operation of a disk system in the NT world.
Former versions of NT (4.0 and 3.5) shipped with no way to defragment disks, but Windows 2000 and XP ship with a
licensed copy of DisKeeper 5, still labeled as Defrag. The main feature removed from this crippled copy is one of the
most useful - a scheduler. Defrag cannot be run in command-line mode, so the only way to ensure a clean disk is
self-discipline or to download an unauthorized freeware add-on that allows scheduling (such as autodefrag). And
another tip - even when you run an analysis and Defrag says you shouldn't bother, don't listen. A machine needs
only a few days to build up large amounts of fragmented files. Defrags should be run once a week, regardless.
Finally, in head to head competitions, most 3rd party commercial products do a better job defragging than the built
in Windows 2000 version. Explore the Norton or PQMagic line of products for better results, albeit at a cost.
Registry and Pagefile Defrag
Even after defragging your system with the built-in software, some system files will remain untouched. This is due to
their being constantly in use and unable to be rearranged. The most critical of them is the pagefile, but the files that
make up the registry and event logs are also locked during OS usage. The answer is PageDefrag, another superb
freeware utility from the crew at SysInternals. PageDefrag allows you to defragment system files during the boot up
process (before they are locked) and can definitely help speed performance. Follow the steps at
http://www.sysinternals.com/ntw2k/freeware/pagedefrag.shtml to save this tiny and excellent utility.
Pagefile Size
As described in the setup portion of the guide, the pagefile configuration goes a long way towards ensuring fast and
efficient operation of an NT based system. After you have just finished the setup portion of Windows 2000 or XP, the
pagefile is set with MS defaults (variably sized, usually set to range from the amount of your physical RAM to about
1.5 times it). To do this:
1. Open Control Panel
2. Open System applet
3. Open Advanced tab
4. Open Performance button
5. Under Virtual Memory, click Change
A. If only one big volume (such as 'C') then change the value to 2.5x your physical memory for minimum and
maximum size, and then hit 'Set'.
B. If using 2 separate physical disks (such as 'C' and 'D') then change the location of the page file to the disk that
does not contain the operating system, then hit 'Set'.
6. Reboot
Faster shutdowns and Boot Ups
Keeping reboot times lower is not necessarily a performance change. But with the number of times you may need to
reboot a machine due to a game crashing, an app leaking memory, or Windows just generally being a pain, making a
restart as quick as possible is definitely a good thing. The changes made below will alter both shutdown and startup
times for the better. Making the changes is simple:
1. Open Control Panel
2. Open System applet
3. Open Advanced tab
4. Open Startup and Recovery button
A. Set the 'display list of operating systems' to 3 seconds
B. Turn off 'send an admin alert' (which is for SNMP traps)
C. Turn off automatic reboot (unless you don't care about reading data from Critical Stops (aka Blue Screen of
Death) )
D. Turn the 'Write Debugging Info' to 'Small Memory Dump 64K'
5. Reboot
Registry Cleaning
The registry is a database of all the critical information required by NT-based operating systems to run. Settings,
drivers, class ID's - all of these things must be constantly read and written to the registry. Keeping the registry
compact and efficient is another key to fast performance. While a highly experienced engineer can walk through and
manually clean a registry to perfection, most people rely on small utilities to do this for them. I recommend
Regcleaner 4.3 (http://www.verkkotieto.fi/jv16/shtml/regcleaner.shtml), which works very well on both Windows
2000 and XP. Follow the instructions at the site for usage. Make sure to choose the 'save backup' and 'auto-clean'
options for a safe and fast compaction of your registry. When used in tandem with PageDefrag, large performance
gains can be realized.
Disable Services
Services are background tasks run by the operating system as helpers. They allow optional components to be run
which add functionality. Out of the box, NT-based operating systems are loaded with services that the home user will
not need. When following these steps, make sure that all of these services get set to manual, not disabled. Setting
them to manual means that the OS can turn them back on if really necessary; setting them to disabled means that
they will stay shut off no matter what, even if they are critical to operation. All of these services consume memory
and CPU, and nearly all are useless to the average home user, as they require a business network to be utilized.
1.
2.
3.
4.
Open Control Panel
Open Administrative Tools
Open Services Applet
Set these to manual unless noted:
Alerter (used for network messaging)
Application Management (used during installs)
Clipbook (used for remote clipboard viewing)
Computer Browser (shows computers on a network)
Distributed Link Client (tracks active directory files on a network)
Distributed Transaction Coordinator (tracks SQL, Messaging on a network)
Fax Service (used for faxing - leave automatic if using FAX)
Indexing Service (creates indices of files for faster file server scans)
Internet Connection Sharing (allows machines to act as internet routers)
Messenger (acts as a router for admin messages on a network)
Net Logon (allows pass-through authentication to NT networks)
NetMeeting Remote Desktop Sharing Service (allows users to remote control your PC desktop through NetMeeting
app)
Network DDE (allows networked machines to share DDE information)
Network DDE DSDM (routes DDE information on a network)
NT LM Security Support Provider (allows non-named pipes security RPC calls)
Performance Logs & Alerts (runs Perfmon tracking)
Print Spooler (allows printing - leave automatic if using a printer)
QoS RSVP Service (used for routing network traffic with priorities)
Remote Access Auto Connection Manager (leave auto if using modem)
Remote Access Connection Manager (leave auto if using modem)
Remote Procedure call RPC Locator (used for all RPC transactions on a network)
Remote Registry Service (Allows machines to connect to your PC's registry)
Routing & Remote Access (allows machine to act as a network router)
Server (allows network connectivity to your machine by other machines for RPC)
SmartCard (allows use of a smart card reader device)
SmartCardHelper (allows use of legacy smart card reader devices)
Task Scheduler (leave automatic if wanting to schedule jobs)
Telnet (allows telnet sessions to connect to your PC)
Uninterruptible Power Supply (leave auto if using battery backup)
Utility Manager (runs certain OS utility services)
Windows Installer (manages the use of MSI install packages)
Windows Time (allows your PC to connect to a SNTP server)
Remember - all of these should be set to manual. They will get started if the OS needs them. Setting them to
disabled may cause the PC to lockup at boot.
Diskperf Counters
By default, Windows 2000 and XP machines are configured to run Disk Performance counters during operation. This
allows the Perfmon utility to be used for determining disk performance and metrics. If you have no need to use this
(it consumes a small amount of resources tracking the disk performance when turned on), follow these instructions:
1. Open a command ('DOS') prompt
2. Type Diskperf -N and hit 'enter'
3. Close command prompt and reboot.
DMA Defaults (New! 12/15/01)
Often times, depending on the scanning done during hardware detection at setup, XP and 2000 will short-change you
on IDE performance. Fast DMA slave devices (such as CD-ROMS and extra drives) may become listed in the older
and less efficient Programmed Input/Output (PIO) mode. By forcing DMA for your DMA devices, you will free up a bit
of CPU for other more important things:
1.
2.
3.
4.
5.
6.
Open Device Manager (located in Control Panel | System).
Expand the IDE ATA/ATAPI Controllers tree.
Open the Primary IDE Channel leaf.
Under the 'Advanced' tab, verify that the Device 0 and 1 dropdowns are set at 'DMA if Available'
Repeat for Secondary IDE Channel leaf.
Reboot.
Application Boosts
There are a variety of changes that can be made to assist performance via the installed applications. A number of
simple steps can greatly reduce CPU, memory, and disk overhead caused by misbehaving non-OS programs. As
always, be sure to make good backups and test changes.
Auto-started applications
Much like the TSR's of the old DOS world, many applications are configured to start without user interaction at logon
time. Some of these applications are noticeable, while some are more devious 'helper' applications, such as the MS
office 'findfast' utilities. Many of them can be turned off with no real ill effects Here's how to check the three (!)
places they can be loaded from:
Start Menu 1. Open Start | Programs | Startup
2. Look at the shortcuts listed; each will point back to an application that runs after the desktop shell loads. Delete
any you don't need or want. Typically, you will see the utterly useless Office Findfast, Office Toolbar, etc.
Machine Run Registry 1. Run Regedit or Regedt32
2. Open key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' and remove any values
that are not needed. Be sure to verify that something important is not being turned off!
User Run Registry 1. Run Regedit or Regedt32
2. Open key 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run' and remove any values that
are not needed. Be sure to verify that something important is not being turned off! It is very possible that there will
be no ‘Run’ key for HKCU; it depends on the application programmers wanting their apps to run on a per-user basis
Running Games High Priority
NT-based operating systems support the running of processes at varying levels of priority. Ordinarily the OS is left to
decide levels of priority, but on older, less powerful processors it may be useful to force an application (such as a
game's core exe) to run higher to maximize performance. Be sure to test this thoroughly, as forcing priority may
cause your system to become unstable, especially with older and slower CPU's. Doing this requires the creation of a
simple shortcut:
1. Create a shortcut
2. Point the target at command-line interpreter executable (ex: c:\winnt\system32\cmd.exe)
3. Add the parameters of '/C "start /HIGH <game executable with path and params>" (ex:
c:\winnt\system32\cmd.exe /C "start /HIGH c:\sierra\half-life\hl.exe -console")
Cleaning old data
Most people know that running too many applications at once hurts PC performance. But another huge factor is
having too many applications installed. Large numbers of files, directories, and data slow down Disk operations; as
the file system has to keep longer and longer indices of file locations, more time is spent figuring out where files are
located and less spent opening them. Uninstalling unused applications and deleting or compressing old data will help
keep disk performance high.
Using TaskMan
Finally, we come to a very simple and useful tool, the Task Manager. Usually used to terminate an errant program,
this utility is much more useful in examining processor and memory usage. Hitting Ctrl-Alt-Del and opening Task
Manager will show you a cornucopia of information. Selecting a column header will sort by type of data, such as CPU
utilization or memory usage. Examining this information can show applications running with large memory leaks,
runaway processes, etc. Even better is the Perfmon utility, which can be used to track historical information and find
out which applications are causing you problems, or where you need to invest in better hardware.
Give up on that GUI #1 (New! 12/15/01)
NT-based operating systems (especially XP) are very graphics memory intensive. Use of massive color depth will eat
away at your system faster than anything, and for not much benefit - the difference btween 16-bit and 32-bit color is
mostly unnoticeable. Here's a way to free up huge chunks of RAM and sizeable CPU cycles:
1.
2.
3.
4.
Right click on your desktop and choose Properties.
In the Settings tab, set color depth to 16-bit.
Test.
Apply.
Give up on that GUI #2 (New! 12/15/01)
Disabling massive wallpapers will free up a lot of graphics memory, as it is easier for the OS to draw windows and
menus over a simple low quality single color background than a complex picture:
1. Right click on your desktop and choose Properties.
2. In the Wallpaper tab, set your wallpaper to none. Apply and close.
Give up on that GUI #3 (New! 12/15/01 - XP Only)
Turning off the bubbly, swoopy, goopy new interface of XP yields good gains in performance. By using the classic
Windows shell, you regain a bunch of RAM and CPU at the loss of some graphics that are questionably useful.
1.
2.
4.
5.
Open Control Panel | Performance and Maintenence.
Open System | Advanced Tab | Performance
Under Visual Effects, select 'Choose Best Performance'.
Apply and close.
Give up on that GUI #4 (New! 12/15/01 - 2000 Only)
For Windows 2000 users, much of the same effects as above can be turned off, but it's not as easy. Still, getting rid
of trivial animations will yield a faster and more satifying performance:
1.
2.
3.
4.
5.
Right click on the desktop and choose Properties.
Open the 'Effects' tab.
Uncheck 'Use transition effects for menus'.
Uncheck 'Show Icons using all possible colors'.
Apply and Close.
XP Bandwidth Throttling Fix (New! 12/15/01 - XP Professional Only)
The Professional version of XP has an interesting setting which will not be useful to gamers, and which is
unfortunately rather irritating to turn off. If done however, it can yield up to a 20% increase in bandwidth for
network connections. But prepare for some involvement:
1.
2.
3.
4.
5.
6.
7.
8.
Log in as Administrator (not 'an' administrator, but as the specific account).
Click Start | Run | gpedit.msc (runs Group Policy Editor).
Expand the tree Computer Configuration | Administrative Templates | Network | QoS Packet Scheduler
Open the 'Limit reservable bandwidth' setting.
Check 'Enable' and set percentage to '0%'. Close gpedit.
Open your Network Settings (Start | My Computer |My Network Connection| View Network).
Open the properties of your connection and verify that QoS Packet Scheduler is enabled.
Close and reboot.
Tuning via the Registry
Finally, we reach the Holy Grail - the Windows Registry. For the experienced and the adventurous, the registry is the
true destination for performance tuning. Nearly all OS configuration data is stored this small database, but not all of
them have a simple GUI interface; using the registry editing tools allows you to bypass these restrictions (some
might say safeguards) and make sweeping changes to how your PC runs. As mentioned previously, these steps
should only be attempted after a good backup of the registry, and will usually have no effect until after a reboot.
Last Access ACL Stamp
The operating system writes a time stamp to every single file each time it's accessed. Turn this off to gain an
incremental boost to disk performance:
1.
2.
3.
4.
Open Regedit or Regedt32
Open the following key: "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem"
Add the following DWORD value name: 'NtfsDisableLastAccessUpdate' and make it '1'
Reboot
Legacy DOS file support
If you are not using old 16-bit DOS applications, remove the support for their file system and regain time lost writing
duplicate disk data:
1.
2.
3.
4.
Open Regedit or Regedt32
Open the following key: "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem"
Open the following DWORD value name: 'NtfsDisable8dot3NameCreation' and make it '1'
Reboot
IOPage Locking Limits
Machines with more memory can force the usage of more RAM vs. swapping files to disk by the use of an override
setting called IOPageLockLimit. These values specify the limiting number of bytes that can be locked for I/O
operations; it defaults to 512 bytes. Only machines with larger amounts of physical memory (I recommend no less
than 256MB RAM) should make these changes. This should be tested extensively and adjusted accordingly - usually
down.
1. Open Regedit or Regedt32
2. Open the following key: "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory
Management"
3. Create the following DWORD value name: 'IOPageLockLimit' and make any of the following changes in
hexadecimal values:
A. For PC’s with 256MB RAM = '2000' (which equals 8192 decimal bytes)
B. For PC’s with 512MB RAM = '4000' (which equals 16384 decimal bytes)
C. For PC’s with 1024MB RAM = '10000' (which equals 65536 decimal byes)
4. Reboot
Tuning TCP #1
Especially for modem users, but also slightly useful for broadband customers, this override setting can be used to
regain 12 bytes for every packet sent; over time this will really add up for low-bandwidth users. Be sure to test this
change right after rebooting, as some ISP's may not support it at the router/server level.
1.
2.
3.
4.
Open Regedit or Regedt32
Open the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP \Parameters"
Open the following value name: 'TCP1320Opts' and make it = '1'
Reboot
Tuning TCP #2
An increase in efficiency of communication can be gained from manipulating TCB's (Transmission Control Blocks). By
telling TCB's to timeout more quickly when TCP sockets are closed, network resources free up and are more
response to other requests.
1. Open Regedit or Regedt32
2. Open the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP
\Parameters"
3. Create the following DWORD value name in Decimal: 'TcpTimedWaitDelay' and make it = '30'
4. Reboot
Tuning TCP #3
Some performance boost can be realized from altering the TCB hash settings, which allows the OS to use larger (and
fewer) TCP connections. This means more are available for use and can theoretically reduce bottlenecking in highbandwidth connections.
1. Open Regedit or Regedt32
2. Open the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP
\Parameters"
3. Create the following DWORD value name in Decimal: 'MaxHashTableSize' and make it = '30'
4. Create the following DWORD value name in Decimal: 'TcpTimedWaitDelay' and make it = '30'
Tuning TCP #4
For users with plenty of physical memory (we recommend no less than 384MB), there is another option which helps
on highly congested networks such as those of DSL or Cable users. by forcing the receive sixe to the max, high
utilization networks will hopefully communicate a bit more efficicently with you.
1. Open Regedit or Regedt32
2. Open the following key: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP
\Parameters"
3. Write the following DWORD value name in hex : 'TcpWindowSize' and make it = 'FFFF'
4. Reboot
Disable Paging Out the NT Executive
Even with 4GB of RAM, an NT-based system will still write it's subsystems out to disk rather than keep them in
memory much of the time, resulting in overall slowdowns in the OS. For systems with plenty of RAM (we recommend
no less than 384MB), a registry hack can be made that will force the OS to run in memory, leading to a dramatic
performance boost
1. Open Regedit or Regedt32
2. Open the following key:"HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session Manager/Memory
Management"
3. Open the following DWORD value name: 'DisablePagingExecutive' and make it = '1'
Reboot
XP Boot Defragger (New! 12/15/01)
Windows XP supports a new feature which used to be the realm of PQMagic and DisKeeper: the ability to defrag
bootstrap files and keep them close together on the hard drive cylinders to allow for a faster bootup. It may or may
not be setup correctly on your PC, especially if you use an OEM copy of XP. Here's how to be sure:
1. Open Regedit or Regedt32
2. Open the following key:"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction "
3. Change the value to Y to enable it.
Download