I myself hosted the WCF service on BasicHttpBinding consumed by ASMX Client . I simulate the simultaneous loading of users of 1200 users . The service method takes a string parameter and returns a string. Data exchange is less than 10 KB. The request processing time is fixed after 2 seconds using the Thread.Sleep (2000) instruction. Nothing extra. I deleted all DB Hits / business logic.
The same piece of code works fine for 1000 concurrent users. I get the following error when I increase the number to 1200 users.
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) --- End of inner exception stack trace --- at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at WCF.Throttling.Client.Service.Function2(String param)
This exception is often reported as a DataContract mismatch and large data exchange. But never when performing a load test. I looked through enough and tried most of the options, which include,
- Server-side tracing and message logging is enabled. But there were no mistakes.
- To overcome the port leak, MaxUserPort is set to 65535, and TcpTimedWaitDelay is set to 30 seconds.
- MaxConcurrent calls have a value of 600 and a value of MaxConcurrentInstances is 1200.
- Open, Close, Send and Receive timeouts are set to 10 minutes.
- The HTTPWebRequest KeepAlive is set to false.
I have not been able to solve the problem in the last two days.
Any help would be appreciated.
Thanks.
source share