Suggestions for Optimizing Memory on an IIS Server

Servers running Internet Information Server, like all high-performance file servers, benefit from ample physical memory. Generally, the more memory you add, the more the servers use and the better they perform. Most IIS servers perform acceptably with 32MB of memory. However, if you are running memory-intensive applications, like Common Gateway Interface (CGI) applications, you might need up to five times more memory to prevent a memory bottleneck.

Here are a few suggestions for optimizing memory performance without adding memory:

Improve data organization. Keep related Web files on the same logical partitions of a disk. Keeping files together improves the performance of the file system cache and reduces the size of the process's working set. Also, defragment your disks. Even well organized files can take more time to retrieve if they are fragmented.

Try disk mirroring or striping. The optimum configuration is to have enough physical memory to hold all static Web pages. However, if pages must be retrieved from disk, use mirroring or striping to make reading from disk sets faster.

Replace or convert CGI applications. CGI applications use three to five times more processor time and memory space than equivalent ISAPI extensions. If you cannot or choose not to replace your CGI applications or to convert them to ISAPI extensions, you might need to add additional processors and memory. For more information on CGI and ISAPI applications, see Chapter 9, "Monitoring Dynamic Page Generation."

Enlarge paging files. Add paging files and/or increase the size of your paging files. Windows NT creates one paging file on the system disk, but you can create a paging file on each logical partition of each disk.

Resize the IIS Object Cache. If the system has enough memory, and most of the IIS Object Cache is used, consider increasing the size of the IIS Object Cache (MemoryCacheSize) or lengthening the period that an unused object can remain in the cache (ObjectCacheTTL). Alternatively, if memory is scarce and the contents of the object cache are volatile, consider reducing the size of the object cache or increasing the rate at which the cache is flushed.

Change the balance of the cache to working set. By default, Windows NT servers are configured to give preference to the file system cache over the working sets of processes when allocating memory space. Although IIS servers benefit from a large file system cache, the Maximize Throughput for File Sharing option often causes the Internet Information Server pageable code to be written to disk, which results in lengthy processing delays. To avoid these processing delays, set Server properties to the Maximize Throughput for Network Applications option.

Û To change Server properties:

1. Double-click the Network icon in Control Panel.

2. Click the Services tab.

3. Click Server to select it, and then click the Properties button.

4. Click Maximize Throughput for Network Applications, and then click OK.

5. Restart the computer.

Limit connections. If your server is running out of memory, limiting the number of connections on the server might help because some physical memory is consumed by the data structures the system uses to keep track of connections.

Administrators can use the Internet Service Manager to limit the number of connections. On the property page for each service, click the Service tab, then change the value in the Maximum Connections field. The following table shows the default values for maximum connections by service.

Table 5.4 Default Values for Maximum Connections

Service

Default Maximum Connections

FTP

1,000

Gopher

1,000

WWW (HTTP)

100,000