Windows XP TCP/IP Connections

By rlaserra ·
Im looking for a way to change the default setting of windows to kill the idle TCP/IP connections. I am running apache HTTP server on windows XP pro machine. Ive tweaked it so I can have 40 connections already but the TCP/IP connections are stuck on TIME_WAIT and I was wondering if there is registry settings or something to kill those connections! It is for a picture server each picture pics up a new thread and is downloaded quickly and the connection needs to drop!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

TIME WAIT connections

TIME_WAIT conenctions have no effect on server load.
There are just lots of connections. TIME_WAIT is your friend unless it prevents more connections from being created or being serviced.
TIME_WAIT is a state where connections could conceivably be re-used without
making a new TCP between servers, so it can help reduce load.

This section will attempt to explain the parameter tcp_time_wait_interval and address the proper way to determine values for the parameter.

A TCP connection enters TIME_WAIT as a result of the
connection being terminated by one or both sides. If a TCP connection is in TIME_WAIT state and the remote transmits data, the side having the TCP connection in TIME_WAIT sends a RST to indicate that data was lost.
tcp_time_wait_interval is the length of time a TCP connection can remain in the TIME_WAIT state. The parameter is reported and set in milliseconds.

One of the most frequently asked questions is, "why is the default setting in Solaris 8 so high? The answer is: it isnt.

from RFC792:

"The graceful close algorithm of TCP requires that the connection state
remain defined on (at least) one end of the connection, for a timeout period of 2xMSL, i.e., 4 minutes"

"TIME-WAIT - represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request.

"TIME-WAIT state removes the hazard of old duplicates for "fast" or "long" connections, in which clock-driven ISN selection is unable to prevent overlap of the old and new sequence spaces.

The TIME-WAIT delay allows all old duplicate segments time enough to die in the Internet before the connection is reopened.

The default in Solaris 8 is 240000 milliseconds (4 minutes) . This value was good for 300 BAUD connections, but may be a bit too long for todays networks and applications. One side effect of using the default value of 4 minutes is that TCP connections can exist in the TIME_WAIT state for 4 minutes. It is possible that TCP connections remaining in TIME_WAIT for this period of time can cause excessive resource consumption in the operating system. "Excessive here means that resources than could have been used for new TCP connections are tied up
in TCP connections in the TIME_WAIT state. A Solaris deployment can function normally with tens of thousands of TCP connections in TIME_WAIT. System administrators sometimes set tcp_time_wait_interval to low values with the expectation that TCP performance will be enhanced. TCP performance will not be enhanced by decreasing tcp_time_wait_interval.

Another factor to consider is the TCP control block chain.
tcp_conn_hash_size controls the number of TCP control blocks in the chain. Consider how many of these blocks would be associated with inactive connections when you measure TCP performance and memory consumption. See also

Additionally, a TCP connection in TIME_WAIT can be re-used by sending a new SYN segment if: assigns its initial sequence number for the new
connection to be
larger than the largest sequence number it used on the previous connection incarnation, and returns to TIME-WAIT state if the SYN turns out to be an old

If tcp_time_wait_interval is set too low, a TCP connection cannot be re-used, resulting in the kernel recovering a resource that could have been re-used, requiring more operating system resources.

Advantages of decreasing tcp_time_wait_interval from the default include:
more rapid recovery of system resources associated with sockets more connections can be handled less memory consumption

And why so many connections?.

Please post back if you have any more problems or questions.

Back to Networks Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums