Monitoring and Tuning Your Server
|
|
Memory Requirements of a Server Running IIS 5.0
Web servers use memory in several ways. A server running IIS 5.0 needs to have enough physical memory to accommodate the following:
- The Program Code for IIS 5.0 This code occupies about 2.5 megabytes (MB) of memory with all services running simultaneously. It is part of the working set of the IIS 5.0 process, Inetinfo.exe, and can—but for performance reasons should not be—paged to disk. (By default, Internet Server Application Programming Interface (ISAPI) dynamic-linked libraries (DLLs) run in a separate memory space in IIS 5.0.)
Note In addition, each connection adds approximately 10 kilobytes (KB) to the size of the working set. Thus, when there are 1,000 simultaneous connections, the working set expands by about 10 MB.
- The IIS Object Cache Objects that are costly to retrieve and frequently reused by the service, such as file handles, file directory listings, and so on, are stored in the IIS Object Cache, a cache maintained by the IIS 5.0 service. The IIS Object Cache is also part of the working set of the IIS 5.0 process, Inetinfo.exe, and can be paged to disk.
- The IIS Template Cache and the IIS Script Engine Cache The IIS Template Cache is a relatively small area of memory that holds, for example, pointers to Script Engines. The IIS Script Engine Cache holds precompiled scripts in Active Server Pages (ASP) (“Script Engines”) that are ready to run. The IIS Template and Script Engine caches are part of the dllhost space by default in IIS 5.0, because scripting is run in the out-of-process pool. (Instances of dllhost in IIS 5.0 are equivalent to instances of Mtx.exe in IIS 4.0.) If this setting is changed, however, and scripting is brought in process, they become part of Inetinfo.exe. For more information about running applications in the out-of-process pool, see Administering an ISP Installation in this book.
- The File System Cache Web page files that are frequently accessed are stored in the operating system’s File System Cache, an area of physical memory reserved for items that are used frequently and repeatedly. The remaining files are stored on disk until needed.
- Overall Memory Usage by the Server. (This is particularly important on multipurpose servers.) This category includes:
- IIS 5.0 Log Files IIS 5.0 maintains one memory-mapped file for each site that has logging enabled. These files are mapped in 64-KB chunks. The mapped segments of the log files are part of the working set of the IIS 5.0 process. Logged data also appears in the File System Cache because data is cached when the file-mapping objects are written to disk.
- TCB Table TCP maintains a hash table, a scheme for providing rapid access to data items, of Transmission Control Blocks (TCBs) that store data for each TCP connection. A control block is attached to the table for each active connection and is deleted shortly after the connection is closed. The TCB table is part of the operating system’s nonpaged memory pool. As such, the TCB table must remain in physical memory; it cannot be paged to disk. TCP sockets are also maintained in nonpaged memory.
- HTTP Connection Data Structures HTTP maintains pageable data structures to track its active connections. When these data structures are in physical memory, they are counted as part of the working set of the IIS 5.0 process.
- Pool Threads The threads that execute the code for IIS 5.0 services are stored in the nonpaged pool in physical memory, along with other objects used by the operating system to support IIS 5.0. Threads in the nonpaged pool must remain in physical memory; they cannot be paged to disk.
Cache sizes, of course, vary depending on the files used by your server and its clients, and on the amount of physical memory present in the server.
Memory consumption is greater for dynamic pages and depends heavily on the type of application involved. For example, an ASP page that formats database tables containing thousands of rows consumes far more memory than even a fairly large static page.
In general, it’s good to have at least 256 MB of RAM; you’ll want more in a server that is performing memory-intensive tasks.
© 1997-1999 Microsoft Corporation. All rights reserved.