win2k3 max tcp connections

we had a particular windows 2003 server that hosted a tomcat app which used mysql for a db. it also had like 3000 agents deployed to workstations that checked in with the server. we started to get a lot of timeout errors and loss of connectivity after the massive agent deployment. tried beefing up mysql, java, tomcat settings along with additional RAM. upgraded to latest version of the tomcat app. the problem still persisted.

so we had a theory that we were maxing out the available amount of TCP connections for the server itself.

netstat -n > output.txt
displays the current TCP connections

and it turns out that windows 2003 has a default of 5000 max available TCP ports. the value can be altered in the following registry key.

HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort

(DWORD)

i changed it to something like 20000.  port usage starts at 1024 to 65534. be sure to reserve ports for any important services that use ports above 1024.

another registry key of interest is “TcpTimedWaitDelay”, decreasing this value might also assist in a situation like this.

update 7/17/12:
this process is not required for windows 2008/vista or above

This entry was written by resinblade , posted on Monday June 22 2009at 10:06 am , filed under IT . Bookmark the permalink . Post a comment below or leave a trackback: Trackback URL.

Leave a Reply

You must be logged in to post a comment.