Connection timeouts to Windows server due to too many TIME-WAIT sockets RRS feed

  • Question

  • Hello,

    I have a proxy application running on a windows 2008 server machine. Recently I started to get connection timeouts when opening connections to the server, although there wasn't any significant load on the server (~500Kbps, ~3000 established connections). Then I found out that the server had around 450K sockets in TIME-WAIT state! It seems as if the OS stopped clearing sockets that got to the TIME-WAIT state at some point and wasn't accepting some of the new incoming connections...

    After rebooting the machine the problem went away... the number of TIME-WAIT connections on the server always returns to zero.

    The server was originally configured with the minimal TcpTimedWaitDelay of 30 seconds.

    How did the server get to this number of TIME-WAIT connections? How can I avoid this in the future?

    This is a proxy server so it is actively opening and closing sockets, meaning it is transitioning to the TIME-WAIT state for each socket it is actively closing. can't escape that... Can I configure the TCP stack not to transition to TIME-WAIT and jump straight to CLOSED state?
    Tuesday, July 6, 2010 5:04 PM