I am doing some performance testing of my .NET Tridion application, simulating 500 simultaneous users requesting the home-page over a 20-minute period. On a lower-spec machine, we quickly encounter the following error:
System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
We are using Tridion 2013 SP1 and DD4T 2.0 on a Windows 2012 Server. After some investigation on the server using
netstat, it seems that a brand new TCP connection is being opened to the content provider endpoint every time the home page is requested. Windows 2012 allows for roughly 15,000 dynamic ports, and these are rapidly used up during the course of my 500-user simulation.
Is there a way of configuring TCP connection pooling for DD4T, or is that outside our control? I believe my question is similar to Connection pooling in the CIL (except that we are using Windows rather than Linux), which suggests that there isn't.
Has anyone else encountered this error and resolved it? :)