One of Microsoft's original design goals for NT 4.0 was to eliminate the seemingly endless number of interacting parameters that you had to set to optimize your system. To accomplish this, Microsoft incorporated adaptive algorithms into NT so that it can change values for these parameters as it runs. This self-tuning reduces the need for manual adjustment, but doesn't eliminate it. As you manage your NT system, two powerful forces pull you in opposite directions. The first is your desire to optimize your system and make it perform better. The second is the common sense that reminds you that if it isn't broken, you shouldn't fix it. But with care, it's possible to balance these forces, taking precautions to avoid disaster while making small changes to boost performance.
Small improvements in performance add up. An extra dozen CPU cycles or a few network collisions encountered during a task don't really reduce performance too much. But if your system executes that task millions of times a minute, even a small performance penalty can add up to serious degradation. You probably wouldn't hesitate to trade your 400MHz processor for a 450MHz one--a 10 percent gain under the best circumstances. This article outlines a few configuration changes that may help you wring more out of your current system.
As with anything you do to configure or optimize your system, take a systematic, scientific approach. Change only one parameter at a time, document what you do, and be prepared to undo it if required. A complete system backup, registry backup, and other precautions are required. Speed up the first 16-bit process The first time you run a 16-bit Windows or command line application on your NT server, you'll experience a delay. That's because NT Server doesn't automatically start its 16-bit sub-systems. If you know that you'll be running 16-bit applications and want to eliminate this delay, tell NT to start the 16-bit sub-system automatically. In Regedit, drill down to the following key:
HKEY_LOCAL_MACHINE/Software/Microsoft/
Windows NT/CurrentVersion/Winlogon
Select the Userinit value and choose Modify from the Edit menu. Add ,win.com
wowexec to the end of the string value. Reboot the server to put this change
into effect.
Optimizing cache behavior
One major difference between NT Server and Workstation is the default cache
model. NT Server normally runs in a Large Cache model, where all RAM not being
used by the system or by applications is marked as available for disk caching.
NT Workstation, on the other hand, uses the Small Cache model. The cache
manager attempts to keep 4MB of RAM free to speed up the launch of new
applications. If you don't load new programs very often, setting NT Workstation
to use the Large Cache model may help you make the most out of the RAM in your
system.
To change the cache model, launch the Registry Editor and drill down to the
HKEY_CURRENT_MACHINE\System\CurrentControlSet\
Control\Session Manager\Memory Management\
LargeSystemCache
key. Double-click on the key to open the Edit DWORD Value window. Enter
0 to use the Small System Cache model and 1 to use the Large
System Cache model. Click OK, close the Registry Editor, and restart your
system.
Limit logged-on users
For any number of reasons, you may find that your server is overloaded with
users. To limit the number of simultaneously logged-on users, possibly
increasing performance for those who are connected, use Regedit to examine the
key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\LanmanServer\Parameters
Edit or Add the DWORD value Users and set the value to the maximum number of
simultaneous log-ons you wish to allow. Reboot to put this change into effect.
RPC out-of-service
Delays of several minutes when opening remote procedure call (RPC) aware
applications, such as Explorer and Control Panel, may be the result of
incorrect service startup settings. You may also see a delay during the initial
load of your desktop. Fortunately, these settings are easily fixed.
From the Start menu, open Control Panel and launch the Services applet. Ensure
that you have the StartUp type for the RPC Service set to Automatic and the
startup type for the RPC Locator set to Manual, as shown in Figure A. If
the RPC Service isn't running, start it now.
Figure A: Set the startup options for your RPC services correctly to save several
minutes of delay when starting applications.
Self-tuning server service
Have you ever run the NET CONFIG SERVER command in conjunction with the
/AUTODISCONNECT, /SERVCOMMENT, or /HIDDEN switches? If so, you may have
unintentionally turned off NT's automatic tuning of the SERVER service. If you
add or remove RAM, for example, appropriate tuning of the SERVER service won't
happen.
To restore automatic tuning, use Regedit to examine the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Services\LanmanServer\Parameters
After making a backup of the registry, select and delete any of the following
values that you (or an application) didn't specifically set:
maxnonpagedmemoryusage
maxpagedmemoryusage
sessconns
sessusers
maxrawbuflen
maxworkitems
opensearch
sessvcs
sessopens
userpath
anndelta
announce
hidden
autodisconnect
users
srvcomment
Next, open Control Panel and launch the Network applet. Select the Services
tab, In the Network Services window, select Server and click Properties. The
Server window presents you with four tuning choices, as shown in Figure
B.
Figure B: Optimize the Server service to match your system's anticipated use.
If you don't use the Server service for file and print sharing, or serve a limited number of clients, try Minimize Memory Used. If you begin to experience error messages saying that the server refused a connection or there wasn't enough server memory/storage to process a request, select Balance instead.
If you choose the Maximize Throughput For Network Applications option, performance will suffer if your system is a primary or backup domain controller or you're running File and Print Services for Microsoft Network Clients. Conversely, services such as the RAS, DHCP, WINS, and IIS will benefit. Recognizing new processors Buying a multi-processor system with fewer than the maximum number of processors installed is a great way to keep your purchase cost down while leaving room for expendability. In some cases, after you add more processors, NT may not automatically recognize them. To encourage recognition, run Regedit and drill down to the key
HKEY_LOCAL_MACHINE/System/CurrentControlSet/
Control/Session Manager/Environment
Edit the string value NUMBER_OF_PROCESSORS to reflect the number of processors
you have installed. Similarly, create or edit the string value
LicensedProcessors and set it to the same value. Be certain that your NT
license is valid for the number of processors you have installed.
Reboot your system and do an update installation (re-install NT into the same
directory), NT will now recognize those extra processors. Re-apply your latest
service pack and hot fixes, and then run RDISK to create a current emergency
recovery disk.
Set processor affinity
If you have a multi-processor system, you can specify the CPU on which it
should execute by setting processor affinity. By giving a process exclusive use
of a CPU and monitoring its usage, you can easily diagnose CPU bottlenecks.
Open Task Manager and select the Processes tab. Right-click your application
and choose Set Affinity from the pop-up menu. Uncheck the processors on which
this application shouldn't run. This technique won't work for system services.
It also works only for applications that are already running--you can't start
an application with a defined affinity.
Drop NTFS legacy naming
To wring the most out of your disk subsystem, you've probably already left the
limitations of the FAT file system behind and formatted your drives as NTFS
volumes. Even so, NTFS still attempts to accommodate legacy applications by
creating an 8.3 alias filename for every file and directory on your system.
If you have 16-bit applications that have trouble finding long filenames,
turning off 8.3 name creation may cause them to fail. If all your applications
are long filename compatible, you can increase NTFS performance by disabling
8.3 name creation.
In Regedit, drill down to the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\FileSystem\NtfsDisable8dot3NameCreation
By default, this value is set to 0, telling NTFS to create an 8.3 alias for
every entry. To disable 8.3 name creation, set this value to 1. This
change will take effect on your next boot.
Eliminate access updates
Each time you access a directory on a Windows NT NTFS volume, by using NT
Explorer or the DIR command, for example, NT updates the LastAccess time stamp
on each directory it detects. If your system contains a very large number of
directories or supports a large number of users and you don't care about the
LastAccess stamp, the small performance hit required for each directory update
adds up to wasted performance without producing any real value.
To prevent the LastAccess time stamp from being updated, start Regedit and
drill down to the key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Control\FileSystem
From the Edit menu, select New, then DWORD Value. Name the new value
NtfsDisableLastAccessUpdate. Set its value to 1 to disable the
LastAccess update.
Boost file I/O
By default, NT allows up to 512k of memory to be locked for I/O operations. If
your system has high file activity and more RAM than it can really use, you can
speed up your file system by increasing this amount from the default 512k to 4M
or more.
In Regedit, drill down to the key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Control\Session Manager\Memory Management
In the right-hand pane, locate the value IoPageLockLimit. This entry is the
maximum number of bytes that can be locked for I/O operations. When the value
is 0, NT defaults to 512K. To change the value, select IoPageLockLimit, then
choose Modify from the Edit menu. Select Decimal or Hexadecimal as the base for
your entry and enter the new value. Click OK.
Before you make any changes, use Performance Monitor to monitor Average Disk
Sec/Transfer for your logical disks. Be sure to monitor performance over a
period of time that represents your typical file system activity. Increase the
size in small increments and monitor performance again until you see no further
improvement. A reasonable maximum limit for this value is one-eighth of your
total system memory.
Move the spool directory
If your system is playing double-duty as both a file and print server, spooling
large jobs to the disk can negatively impact your file performance. If you have
more than one drive in your system, you can speed up both tasks by putting the
print spool on a different drive than your most popular files. Moving the spool
to a separate disk and controller works even better.
To change the default printer spool directory for all printers, use Regedit to
examine the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Control\Print\Printers
Set the value DefaultSpoolDirectory to reflect the full path to printer spool
directory. If the specified directory doesn't exist, NT will use its default
spool directory.
You can also change the default printer spool directory for each specific printer installed on the system. Under the
HKEY_LOCAL_MACHINE \SYSTEM\CurrentControlSet\
Control\Print\Printers
key, open the key for the printer whose spool you want to move. Edit the string
value SpoolDirectory to reflect the full path to the new spool directory, as
shown in Figure C.
Figure C: Separating your print spooling from other disk activity can speed up both
activities.
Faster saves to a server share
If a network client is ignoring your server's Oplocks break request when saving
a document to the server's share, it may experience a delay. If this type of
delay is widespread, the simplest solution is to disable opportunistic locking
on the server.
In Regedit, drill down to the key
HKEY_LOCAL_MACHINE/System/CurrentControlSet/
Services/LanmanServer/Parameters.
From the Edit menu, select Add, and then DWORD Value. Rename the new value
EnableOplocks and set it to 0. Reboot to enable this change.
Don't cache roaming profiles
Roaming profiles make it easy to move from machine to machine. But each time
you log off a workstation, you leave a copy of your profile cached on the local
hard disk. By default, Windows NT stores up to five locally cached profiles.
You'll probably find this to be too many, wasting disk space, or too few,
requiring that profiles be retrieved too often.
To change the number of cached profile that NT will store, use Regedit to drill
down to the key
HKEY_LOCAL_MACHINE\Software\Microsoft\
Windows NT\CurrentVersion\Winlogon
Edit or add a DWORD Value named CachedLogonsCount. The valid range for
this value is 0 to 50.
As an alternative, to configure NT so that roaming profiles aren't cached, edit
or add the DWORD value DeleteRoamingCache and set it to 1.
Realistic disk full warnings
NT posts an alert, visible under Event Viewer, when the amount of free space
remaining on your drive falls below 10 percent. That was great when drives were
small. But if you have a 9G drive, you get a warning when you still have 900M
of space available!
To set the warning threshold to a level that better suits your needs, use
Regedit to drill down to the key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\LanmanServer\Parameters
Add a new DWORD value and name it DiskSpaceThreshold. Select it and
choose Modify from the Edit menu. Check the Decimal button and enter the
percentage of free disk space remaining, from 0 to 99, at which you want NT to
alert you.
Balancing NIC loads
Adding two NICs on the same wire is an inexpensive way to increase your network
throughput. But unless NT balances the load between the two NICs, you won't get
the full benefit.
To ensure balance, use Regedit to add two entries. Drill down to
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\NetBT\Parameters
From the Edit menu, choose New, and then DWORD Value. Name the value
RandomAdapter and set its value to 1. Similarly, create a DWORD
value named SingleResponse and set its value to 1. To disable
load balancing, set either value to 0.
Boost redirector buffers
If you increase the number of buffers that the redirector reserves for your
network, it may improve your network throughput. Each extra execution thread
that you add beyond the default will take 1k of additional non-paged pool
memory, but only if your applications actually use them.
To configure additional buffers and threads, use Regedit to drill down to the
key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\LanmanWorkstation\Parameters
If not present, add the DWORD value MaxCmds and the DWORD value
MaxThreads. The valid range for these values is 0 to 255, with a default
value of 15. Set both to the same value.
You may also want to increase MaxCollectionCount, a DWORD value in the same
key. This value represents the buffer size for character-mode named pipe
writes. The default value is 16 and the valid range is 0 to 65535.
Low-traffic; speed-up
If traffic is light on your TCP/IP network and your server has ample memory,
increasing the default request buffer size of 4356 bytes will often speed up
the network. Before implementing this change, establishing a baseline for your
network using Performance Monitor,
In Regedit, drill down to the key
HKEY_LOCAL_MACHINE\System\CurrentControlSet\
Services\LanmanServer\Parameters
and add a new DWORD value. Name the value SizReqBuf. Allowable buffer
sizes range from 512 to 65536 bytes. Heuristic testing has shown that most
standard Ethernet environments will show an improvement with a buffer size of
14596 (decimal). Reboot the server to complete the change.
Faster remote DNS searches
If you have a server located at your remote office, you can reduce the network
traffic to your local DNS Server by installing a caching-only Domain Name
System at each remote site. A caching-only server looks up names for clients
and caches them. Depending on your usage patterns, many local requests may
eventually be satisfied from the local DNS cache, reducing network traffic.
To create a caching only server on your remote server, install DNS and run the
Domain Name System Manager. Click on the DNS menu, select New Server, and type
in the IP address of the new caching-only server.
Conclusion
Small configuration changes can't make up for inadequate processing, memory,
disk storage, or network bandwidth, but they can be used to fine-tune your
system for a specific task or better overall performance. The only real way to
evaluate the effectiveness of your efforts is to monitor performance before,
during, and after each scenario. By establishing a baseline--and checking it
regularly--you'll be in a position to note bottlenecks before they become too
serious or anticipate problems by changes in performance throughput.
Copyright © 1999, ZD
Inc. All rights reserved. ZD Journals and the ZD Journals logo are trademarks of ZD
Inc. Reproduction in whole or in part in any form or medium without
express written permission of ZD Inc. is prohibited. All other product
names and logos are trademarks or registered trademarks of their
respective owners.