The Performance Overhead of Connections

Each connection that an IIS service establishes consumes some processor time. The network adapter card interrupts the processor to signal that a client has requested a connection. Further processing is required to establish and maintain the connection, to fulfill client requests sent on the connection and, when the connection is closed, processing is required to delete the structures that serviced the connection. Each time a connection is established, the load on the server increases.

One aspect of connection overhead is the time it takes to search the Transmission Control Block (TCB) table. TCP creates and maintains transmission control blocks (TCBs) to store data about connections. This might include data about the precedence of the connection and its local and remote socket numbers. The TCBs are stored in a hash table for efficient control. The hash table is stored in the operating system's nonpaged memory pool.

Internet Information Server 2.0 includes several features to optimize its handling of connections. Among these features are HTTP keep-alives.

HTTP keep-alives maintain a connection even after the connection's initial request is complete. This feature keeps the connection active and available for subsequent requests. Keep-alives are implemented to avoid the substantial cost of establishing and terminating connections. Both the client and the server must support keep-alives. Keep-alives are supported by Internet Information Server version 1.0 and later and Internet Explorer version 2.0 and later.

HTTP keep-alives are different from and independent of Transmission Control Protocol/Internet Protocol (TCP/IP) keep-alives. TCP/IP keep-alives are messages sent to determine whether an idle connection is still active.

HTTP keep-alives are enabled in Internet Information Server by default. Although keep-alives significantly improve bandwidth performance on most servers, you can modify or eliminate them if they are not needed. You can also measure their effect on the performance of your system. To test their effect on the server, you can disable them, but it is recommended that you reenable them when the test is concluded to maintain the performance of the server.

You can disable keep-alives by adding the AllowKeepAlives value entry to the Registry and setting its value to 0. To reenable keep-alives, delete the AllowKeepAlives value entry, or set it to 1. You must place AllowKeepAlives in:

HKEY_LOCAL_MACHINE\System
\CurrentControlSet
\Services
\W3SVC
\Parameters