Retime the IIS Object Cache 4
Consider shortening the period of time that an unused object remains in the cache, or lengthening the time that a used object remains in the cache, by adding the ObjectCacheTTL entry to the registry.
Caution
Do not edit the registry unless you have no alternative. The registry editor bypasses standard safeguards, allowing settings that can damage your system, or even require you to reinstall Windows. If you must edit the registry, back it up first and see the Registry Reference on the Windows Server 2003 Resource Kit companion CD or on the Web at http://www.microsoft.com/reskit. The value of ObjectCacheTTL controls the static file cache by specifying the Time To Live (TTL), which sets the length of time that objects are held in cached memory. If an object in the memory cache has not been referenced for the defined period, that object is phased out of the cache. The default value is 30 seconds. If system memory is limited or if the contents of the server are dynamic, you can use a lower TTL to prevent system memory from being used to cache a large number of volatile objects. Setting the ObjectCacheTTL entry to unlimited disables the object-cache scavenger and allows cached objects to remain in the cache until the cached object changes. Disabling the cache scavenger is useful if your server has ample system memory and your data is relatively static. Use the following procedure to reset the time that an unused object remains in the object cache by adding the ObjectCacheTLL entry to the registry.
Important
You must be a member of the Administrators group on the local computer to run scripts and executables, or you must have been delegated the appropriate authority. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyMachine\Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (including the full path with parameters, if any).
To reset the period that unused objects remain in the cache 4
1. From the Start menu, click Run, type regedit.exe, and then click OK. 2. In the registry editor, navigate to the following subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters 3. Right-click the Parameters subkey, point to New, and then click DWORD Value. 4. In the New Value box, type ObjectCacheTTL 5. Right-click ObjectCacheTTL, and then click Modify. 6. Under Base, click Decimal. 7. In the Value Data box, type the number of seconds that you want an unused object to remain in the cache, and then click OK. The default value is 30 (seconds). You can enter any value from zero, to disable caching, through 4,294,967,295 (unlimited), to disable the object-cache scavenger and allow cached objects to remain in the cache until the cached object changes.
Change the Balance of the File System Cache to the IIS 6.0 Working Set
By default, servers running Windows Server 2003 are configured to give preference to the file system cache over the working sets of processes when allocating memory (through the server property Maximize data throughput for file sharing). Although IIS 6.0�based servers benefit from a large file system cache, giving the file system cache preference often causes the IIS 6.0 pageable code to be written to disk, which results in lengthy processing delays. To avoid these processing delays, set server properties to maximize data throughput for network applications.
To maximize data throughput on the server for network applications 4
1. In Control Panel, double-click Network Connections, right-click Local Area Connection, and then click Properties. 2. Select File and Printer Sharing for Microsoft Networks, and then click Properties. 3. Under Optimization, select Maximize data throughput for network applications.
Limit Connections
If your server does not have enough memory, limiting the number of connections on the server might help alleviate the shortage because some physical memory (about 10 KB per connection) is consumed by the data structures that the system uses to keep track of connections. For more information about limiting connections to save memory, see �Limiting Connections to Manage Resources� earlier in this chapter. Limit the Queue Length for Application Pools
If you are running your server in worker process isolation mode, you can limit application pool queue lengths to prevent large numbers of requests from queuing up and overloading your server. When the queue length limits feature is enabled (it is enabled by default), IIS monitors the number of requests in a designated application pool queue before queuing a new request. Use IIS Manager to change the default limit of 1,000 requests for application pool request queues.
If adding a new request to the queue exceeds the maximum queue length, the server rejects the request and sends a 503 error (Server Too Busy) to the client. However, requests that are already queued remain queued even if the limit is changed to a value that is less than the current queue length.
Use the following procedure to set a limit on the queue length for an application pool. 4
Important You must be a member of the Administrators group on the local computer to perform the following procedure or procedures, or you must have been delegated the appropriate authority. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /User:Administrative_AccountName �mmc %systemroot%\system32\inetsrv\iis.msc�.
To change an application pool�s queue length limit 1. In IIS Manager, expand the local computer, expand the Application Pools folder, right-click the application, and then click Properties. 2. On the Performance tab, under Request queue limit, select the Limit the kernel request queue to check box. 3. In the requests box, type or select the maximum number of queued requests to allow. The default limit is 1,000 requests.
Important If you clear the Limit the kernel request queue to check box, IIS does not apply a request limit. Without a limit, IIS might queue requests until your server runs out of memory.
4. Click Apply, and then click OK.
For information about configuring application pool queue length limits by using metabase properties, see the AppPoolQueueLength property in the �Metabase Property Reference� in IIS 6.0 Help.
Adjust Resource Allocation in Windows 4
System processing is managed by Windows Server 2003, which can allocate processor and memory resources among tasks. If your server needs a temporary performance boost, you can temporarily adjust resource allocation in Windows to allocate the resources where you need them: # To obtain a faster response time, you can set Windows to allocate more processor time to the program that you are currently running. # If you want to run background programs, such as printing or disk backup, while you work, you can have Windows share processor resources equally between background and foreground programs.
For more information about changing the way that Windows allocates processor resources, see �Change the performance of foreground and background programs� in Help and Support Center for Windows Server 2003. Limit Performance Logging
Always keep in mind that performance logging uses system resources. When you are not actively checking performance, disable performance-related logging to squeeze a bit more performance from your server. 4
Configuring ServerCacheTime for SSL Sessions 4
If you plan to support long SSL sessions, consider lengthening the SSL cache time-out interval by adding the ServerCacheTime entry to the registry. If you expect thousands of users to connect to your site by using SSL, estimate how long you expect SSL sessions to last, and then set the value of the ServerCacheTime entry to a number slightly higher than your estimate. Do not set the value much higher than your estimate, because the resulting time-out interval might cause your server to retain stale data in the cache.
Caution The registry editor bypasses standard safeguards, allowing settings that can damage your system, or even require you to reinstall Windows. If you must edit the registry, back it up first and see the Registry Reference on the Windows Server 2003 Resource Kit companion CD or on the Web at http://www.microsoft.com/reskit. One reason for changing the default value for the SSL session cache is to force the client to authenticate more often. More frequent caching is sometimes useful, for example, if you know that the client is using a smart card and you want the Web page to be accessible only when the user inserts the smart card in the reader. Before changing the SSL cache time-out interval, make sure that HTTP Keep-Alives are enabled (HTTP Keep-Alives are enabled by default). SSL sessions do not expire when you use them with HTTP Keep-Alives except when the browser closes the connection.
Important You must be a member of the Administrators group on the local computer to run scripts and executables, or you must have been delegated the appropriate authority. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type
runas /profile /User:MyMachine\Administrator cmd
to open a command window with administrator rights and then type
cscript.exe ScriptName (including the full path with parameters, if any).
To configure the ServerCacheTime registry entry 4
1. From the Start menu, click Run, type regedit.exe, and then click OK. 2. In the registry editor, navigate to the following subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL. 3. Right-click the SCHANNEL subkey, point to New, and then click DWORD Value. 4. In the New Value box, type the following: ServerCacheTime 5. Right-click the ServerCacheTime entry and then click Modify. 6. Under Base, click Decimal. 7. In the Value Data box, type the value (in milliseconds) that you want to assign for the cache time (1 minute = 60,000 milliseconds), and then click OK.
Commonly used cache times converted to milliseconds 4 |
Desired Cache Time (1 minute = 60,000 milliseconds) |
ServerCacheTime Value (in Milliseconds) |
No secure session caching |
0 (turns off session caching) |
2 minutes (default setting for the Microsoft� Windows NT� version 4.0 operating system) |
120000 |
5 minutes (default setting for the Microsoft� Windows� 2000 operating system) |
300000 |
10 hours (default setting for Windows Server 2003, Windows 2000 with Service Pack 2 [SP2] or later, and Windows XP) |
36000000 |
For more information about configuring SSL session caching, including how to set the ClientCacheTime registry setting, see article 247658, �Configure Secure Sockets Layer Server and Client Cache Elements,� in the Microsoft Knowledge Base. To find this article, see the Microsoft Knowledge Base link on the Web Resources page at http://www.microsoft.com/windows/reskits/webresources. |
http://download.microsoft.com/download/7/4/f/74fe970d-4a7d-4034-9f5d-02572567e7f7/19_CHAPTER_6_Optimizing_IIS_6.0_Performance.doc <<<----- The full book is located at: http://www.microsoft.com/downloads/details.aspx?FamilyID=80a1b6e6-829e-49b7-8c02-333d9c148e69&DisplayLang=en#filelist and will provide your Server Admin and those concerned with managed code with a lot of great "bed-side reading". ;-I
|