Performance Registry Secrets
Table of contents
Abstract
In this chapter, you will find specific ways to improve the performance of your general Windows NT system, your network, your file systems, and your printers. Mark Russinovich contributed to this chapter, selecting some of his favorite performance-oriented registry modifications to help you squeeze every drop of power from your Windows NT machines.




GENERAL SYSTEM PERFORMANCE

The tuning parameters in this section tune the general performance of NT, rather than a specific aspect of NT such as file systems or memory. By our definition, these keys tune NT itself, not specific device drivers or user-level applications.

VI-1 Managing the number of threads can help you optimize performance. When NT boots, it creates a pool of worker threads that NT’s kernel, Executive Subsystems, and device drivers use. When one of these components places a work item, such as the Cache Manager’s lazy cache flusher or the Memory Manager’s idle memory zero-filler, in a queue, a thread is assigned to process it. If too many threads are in the pool, they needlessly consume system resources. However, if not enough threads are in the pool, work items are not serviced in a timely manner. Adjust the following two registry keys to change the number of threads.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control\Session Manager\Executive
Value Name: AdditionalCriticalWorkerThreads
Data Type: REG_DWORD
Value: <any number>

VI-2 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Control\Session Manager\Executive
  Value Name: AdditionalDelayedWorkerThreads
  Data Type: REG_DWORD
  Value: <any number>

The number you specify in the value increases the number of threads created for the specified work queue. NT has two thread queues. Threads in the Critical Work Queue execute in the low real-time priority range, so they have precedence over most system activity. Threads in the Delayed Work Queue have a slightly lower priority that results in higher latency — the threads that service it compete with other processing for CPU time. The number of threads created for each queue is based on two criteria: whether the system is a server or workstation and how much physical memory the system has. You can’t tell directly whether more threads in a particular situation give you better performance, but you can experiment with benchmark workloads to see if they provide a benefit.

VI-3 To make your foreground windows more responsive than your background windows, in Windows 3.51 you could boost priorities. In NT 4.0 Workstation, instead of boosting priorities, you set quantums to boost foreground windows (Server treats foreground and background windows alike). Change this registry entry to set the boost value.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control
Value Name: PriorityControl
Data Type: REG_DWORD
Value: 0

You can also set the boost value with a slider in the Performance tab of the System Control Panel applet. Valid values are shown below.

0 No quantum boost for foreground windows
1 Foreground windows have quantums twice as long as other windows
2 Foreground windows have quantums three times as long as other windows

VI-4 Here’s a tricky registry entry.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control\Session Manager\Executive
Value Name: PriorityQuantumMatrix
Data Type:  
Value:  

Although you can’t use this value to enhance performance, its name implies that you can. This value actually encodes expiration data about NT Beta and Release Candidates.


MEMORY PERFORMANCE

When you think of memory performance, fast SRAMs and multilevel caching come to mind. Although these hardware components play a critical role in the latency and throughput of a computer’s memory subsystem, tweaking the Registry obviously cannot upgrade your machine’s hardware. So in this section, improving memory performance means improving the way NT uses physical and virtual memory. You know you’re experiencing memory problems that you can fix with registry entries, rather than additional hardware, when you get “not enough memory to complete task…” messages in the system Event Log or on the display monitor.

VI-5 The file system cache grows and shrinks as the applications’ memory demands change. However, at system startup, the cache’s minimum, maximum, and “ideal” sizes are calibrated based on the Registry value you set below.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control\Session Manager\
Memory Management
Value Name: LargeSystemCache
Data Type: REG_DWORD
Value: 0

This value controls the size of the system’s file system cache. A value of 0 indicates a small cache, which is the default setting for Workstation, while 1 indicates a large cache, which is the default setting for Server. Servers usually perform some file sharing and therefore require a larger cache.

VI-6 NT categorizes memory as either paged or nonpaged. Paged memory holds data that can temporarily be moved from physical memory to the system’s paging file if space is needed for different data in physical memory. Nonpaged memory stores data that must be present in physical memory at all times. NT allocates a portion of physical memory for nonpaged memory when the system starts up, and this allocation can’t grow. If drivers or NT exhaust this storage, the system may become unstable or operations may start to fail. Modifying these two registry entries lets you override the defaults set for the paged and nonpaged pools.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control\Session Manager\
Memory Management
Value Name: NonPagedPoolSize
Data Type: REG_DWORD
Value: <number in bytes >

This value is the number of bytes of physical memory you want to allocate for nonpaged memory. To monitor your memory, use Performance Monitor to watch the percentage of committed memory that’s used. If more than 80 percent of memory is used consistently, you should increase this value. Likewise, if the system’s nonpaged memory usage is low, reducing the amount allocated for it increases system performance.

VI-7 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Control\Session Manager\
Memory Management
  Value Name: PagedPoolSize
  Data Type: REG_DWORD
  Value: <number in bytes >

This value is the number of bytes in the paged memory pool. It overrides the system’s default calculation, which is roughly equal to the physical memory on Workstation and a minimum of 50 MB on Server. Paged pool is different from virtual memory size — the paged pool is space reserved in the system’s virtual memory map for NT and device drivers to allocate pageable data.

You can monitor the amount of paged pool the system uses with the Performance Monitor, which also shows the maximum allocation possible. If the amount of memory used is consistently more than 80 percent, you should use this setting to override the default.


NETWORKING PERFORMANCE

The registry gives you lots of control over Windows NT’s various networking components. Because your system may not run every networking service, you should identify which components are active so that you can target them when evaluating networking performance with tools like Performance Monitor.

General Networking
VI-8 This value controls the order in which your network redirectors are used. If you have more than one network redirector, such as Lanmanager Workstation or Client Services for NetWare, loaded on your system, you should consider changing this entry.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Control\NetworkProvider
Value Name: Order
Data Type: REG_SZ
Value: <redirector name,redirector name,redirector name>

In this value, you set the order in which the WNet API uses your network providers. When the WNet API is called, it processes requests by sending them to each network provider in the order listed. If it gets back a response that the provider doesn’t process that type of request, the API calls the next provider listed. Thus, if most of your system’s activity relates to accessing NetWare shares, you should move the NetWare provider name to the start of the list. This small modification can improve performance significantly.

Redirector
The Windows NT Redirector manages remote volume connections. When you access a volume across the network, Redirector takes the file system request and invokes the appropriate protocol to send the request to a file system server component on the other machine.

VI-9 The entry below switches the behavior of Redirector between write-through and write-behind. By default, Redirector delays sending the server write requests to a volume, which lets other operations proceed or complete. When you change this value, Redirector sends write operations immediately and waits for a response before proceeding with other operations.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\Rdr\Parameters
Value Name: UseWriteBehind
Data Type: REG_DWORD
Value: 0

To disable write-behind, change this value to 1; the default is 0. You may need to use this highly synchronous mode in specialized environments or when tracking down networking problems with a network monitoring tool; otherwise, you should use the write-behind value because write-through degrades performance.

VI-10 The value in the registry entry below is a hybrid between write-through and write-behind modes.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\Rdr\Parameters
Value Name: UseAsyncWriteBehind
Data Type: REG_DWORD
Value: 1

The default value of 1 enables asynchronous write-behind, which means that Redirector immediately sends write requests to the server but doesn’t wait for a response before processing other requests. Changing the value to 0 disables asynchronous write-behind; you should disable it only when the network requires special coherency guarantees or when you’re debugging.

Lanmanager Workstation
Lanmanager Workstation is Microsoft’s implementation of a Redirector. It speaks SMB (Server Message Block).

V-11 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Services\LanmanWorkstation\ Parameters
  Value Name: MaxCmds
  Data Type: REG_DWORD
  Value: 15

This value specifies the number of threads that the Workstation service creates during initialization to handle requests; the default value is 15. If Workstation has more requests than it has threads to service those requests, it holds up some requests until a thread finishes servicing a request. Therefore, if multiple users or applications are simultaneously accessing remote shares, increasing this value can improve network throughput.

VI-12 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Services\LanmanWorkstation\ Parameters
  Value Name: SessTimeout
  Data Type: RED_DWORD
  Value: 45

This value sets the number of seconds after a request is queued before Lanmanager indicates that the request has failed (if it hasn’t been processed). The default value is 45. Applications that access network shares may report not having enough memory to process a request — too many outstanding operations are on the volume and some requests are timing out. Raising this value lets more operations be serviced asynchronously and may cause the messages to go away.

VI-13 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Services\LanmanWorkstation\ Parameters
  Value Name: CacheFileTimeout
  Data Type: REG_DWORD
  Value: 10

This value specifies the time after which Lanmanager Workstation purges its locally cached data after closing a file. Many applications open files, perform an operation, close them, and repeat this sequence to perform more operations. If you have a system with a dedicated application, you can adjust this value to improve performance. Increase the time if applications close and reopen the same files at intervals longer than 10 seconds, and reduce the time if applications access few files and do not open and close them regularly.

VI-14 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Services\LanmanWorkstation\ Parameters
  Value Name: DormantFileLimit
  Data Type: REG_DWORD
  Value: 45

This value sets the number of files that Lanmanger leaves open in the file system cache after an application closes it. By default, Lanmanager Server allows only a certain number of open files from any one Lanmanager Redirector connection. Having a file open on the connection can improve performance if the application opens it again. However, keeping files open can also overload the server’s limit, and in those cases you should reduce this value.

VI-15 Normally, Lanmanager Workstation reads and stores data in the local file cache before an application requests it. These read-aheads can cause network degradation when applications rarely read files sequentially on shared volumes or when the network’s throughput is low. To better manage the read-ahead function, change this registry entry.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanWorkstation\ Parameters
Value Name: ReadAheadThroughput
Data Type: REG_DWORD
Value: -1

This value sets the minimum network throughput, in kilobytes per second, before Lanmanager Workstation enables the read-ahead function. The default value is -1.

Lanmanager Server
Lanmanger Server is Microsoft’s implementation of an SMB (Server Message Block) file server. It is a focal point of performance tuning for any file-sharing server.

VI-16 If you frequently get “server paged” or “server nonpaged” errors in Performance Monitor, you are seeing Lanmanager Server running out of memory that it’s allocated for itself. You may want to raise these values to give Lanmanager Server more memory; however, giving these memory resources to Lanmanager keeps other system drivers and applications from using them. To give Lanmanager more paged and nonpaged memory, change the registry entries below.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: MaxNonPagedMemoryUsage
Data Type: REG_DWORD
Value: 0

VI-17 Hive: HKEY_LOCAL_MACHINE
  Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
  Value Name: MaxPagedMemoryUsage
  Data Type: REG_DWORD
  Value: 0

These values set the number of megabytes allocated by Lanmanager Server for nonpaged and paged memory. The default, which is determined internally, is 0.

VI-18 By default, Lanmanager Server’s worker threads run at one priority level higher than typical application threads. If network throughput is low because the Server’s threads are competing with other threads for processor time, you may want to change this registry entry to increase the priority boost.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: ThreadPriority
Data Type: REG_DWORD
Value: 1

Valid values are 0, 1, or 2, which determine how many levels above normal priority Lanmanager’s worker threads run; and 15, which makes Lanmanager Server’s threads run at real-time priority. Increasing the priority may reduce the responsiveness of other applications and services on the machine, especially if you set it to real-time priority.

VI-19 When the server maintains extra pre-initialized end-points, establishing new connections takes less processing. This value sets the number of end-points the server maintains.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: MinFreeConnections
Data Type: RED_DWORD
Value: 2

Valid values range from 2 to 5; the default is determined internally. You can reduce the value to minimize idle memory overhead when the memory resources on the system are in high demand.

VI-20 If memory resources are scarce or if you want to limit the total number of users that can simultaneously log on to the server, change this registry entry.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: Users
Data Type: REG_DWORD
Value: <number>

The value is the number of users who can long on to the server simultaneously.

VI-21 Every time a connection is made to Lanmanager Server, resources are allocated to service it. Sometimes idle connections tie up resources for a long time. To free resources sooner, change this registry entry.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: AutoDisconnect
Data Type: REG_DWORD
Value: 15

This value specifies the number of minutes a connection can be idle before it is automatically disconnected and the resources associated with it are freed. The default value is 15. Reducing this value can keep resource usage to a minimum, but it’s possible to incur additional overhead if clients reconnect after their connections are dropped.

VI-22 The registry entry below tells Lanmanager Server to allocate work items for processing raw SMBs (Server Message Blocks).

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: EnableRaw
Data Type: REG_DWORD
Value: 1

Setting this value to 1 (the default) enables support for raw SMBs, and performance improves. Setting this value to 0 disables support.

VI-23 Opportunistic locking is a performance-enhancing protocol Windows NT file systems use to detect remote machines’ modifications to shared files and directories. Enabling op-locks can cause you to lose cached data if the system fails.

Hive: HKEY_LOCAL_MACHINE
Key: System\CurrentControlSet\Services\LanmanServer\ Parameters
Value Name: EnableOpLocks
Data Type: REG_DWORD
Value: 1

The default value is 1, which enables op-locking. Change the value to 0 to disable this feature.



Page: 1, 2

next page
Hosted by www.Geocities.ws

1