2

Our application includes an ASP.Net web service that only needs to deal with a handful of clients. As such, the 10 incoming connection limit of Windows XP Pro is generally not a problem. However, on one particular server, connections are occasionally becoming stuck in the CLOSE_WAIT state. These connections build up over time and eventually new client connections are refused because the maximum number of connections are used up.

From my googling it sounds like a failure of the webservice to properly close the connection can cause this problem, but as it works just fine on hundreds of other Windows XP pro machines I can't see it being a bug in our code. It also ran fine on the affected machine until some shenanigans on the part of the end user (I think they set about deleting duplicate files in order to reduce their disk usage, but they did not exactly come clean about it).

What could the user have changed to introduce this problem? Is there any way I can force connections that are in CLOSE_WAIT to time out rather than letting them hang around? I have seen suggestions to reduce TcpTimedWaitDelay, but that only relates to the TIME_WAIT state, and changing it did not have any effect.

1

1 Answer 1

0

An issue like that is usually code related with objects that need to be closed and disposed, but your story suggests that it's not in this case. I would check your connection timeout on the Web Site tab for the website. The default is 120 seconds. If that has been raised then it may keep more connections around than on your other machines.

Also check the IIS logs to see if you have unusual traffic. If you have bots or something else visiting your site more often, you may be reaching the connection limits earlier than in the past.

2
  • Good tip, thanks. The timeout for the website was set to 900 seconds (15 minutes). I reduced it to the default and the connections started to drop off after a few minutes. I suppose what this would indicate is that rather than accumulating over weeks (as I thought), the connections are just becoming maxed out during busy periods that require more than ten connections within 15 minutes. Mar 18, 2011 at 11:06
  • I don't think this is the entire story though, because I checked a few other clients PCs and they also had the timeout set to 900, but do not have this problem. I will keep an eye on it with the reduced timeout anyway. Mar 18, 2011 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .