If your Web site connects virtual directories to shares on a remote computer running Windows 2000 or later, IIS uses Server Message Block (SMB) work-contexts to detect directory change notifications on the remote computer. IIS listens for change notifications in order to purge files in the ASP template cache and the IIS static file cache and to replace them with fresh data from the changed files on the remote share. If these caches are not turned on, IIS must retrieve content from the remote share, and for ASP pages, compile any scripts they contain for every user request. These are expensive processes.
By default, Windows XP accepts requests to 50 SMB work contexts but you can establish a maximum of 2048 SMB worker contexts. Because the remote computer restricts the number of SMB work contexts it accepts, automatic updates to cached files can fail. The following errors are symptoms that SMB calls are failing:
When SMB calls fail, IIS continues to serve unchanged, outdated ASP scripts from the ASP template cache and outdated static pages from the IIS static file cache. In these cases, refreshing the caches requires restarting IIS. You can manage problems associated with connections to remote shares in the following ways:
If you need to create thousands of virtual directories that acquire data from a single remote computer, build a deep virtual directory tree, rather than a wide one. IIS can monitor changes within subdirectories of high-level virtual directories. For example, if you need data from 2500 virtual directories that access a single remote server, you can create 25 top-level virtual directories with 100 subdirectories each. This creates a virtual directory tree with fewer remote connections than the Windows XP default limit of 50 per client.
You can resolve the problem of connection limits for both dynamic data and static file data by:
Distributing your content between two or more remote servers may solve the problem without requiring any restructuring of your site's virtual directories. For example, suppose you are connecting 3000 virtual directories for your site to one remote server. If you move half the content to a second remote server, you can connect half the virtual directories to the second remote server and reduce the number of connections to each remote server to 1500.
You can achieve similar benefits if you store some of the content locally, reducing the total number of procedure calls required. By moving or replicating all the content to the local server, you eliminate the problems associated with managing connections to remote shares and remove the need to listen for UNC directory changes.
You may solve the problem of connection limits by raising the connection limit on the remote computer to the maximum of 2048 connections per client. Then, your site can establish more simultaneous connections to the server.
Maximizing the number of connections that the server requires setting two keys in the registry:
For information on changing the registry, see "Add and Delete Information in the Registry Editor" and "Edit Registry Data" in the Help topics for RegEdt32.exe.
If you cannot effectively resolve the connection limit problem using one of the solutions above, you can turn off the ASP template cache, the IIS static file cache, or both, reducing or removing the need to connect to the remote server to listen for changes. However, this slows the delivery of pages to clients and can result in performance that is unacceptably poor.
To turn off the ASP template cache:
To turn off the IIS file cache: