I have got the following scneario:
Our .NET client calls our WCF service - which in turn calls an external third party service to retrieve some data. Once the data is retrieved, our WCF service sets some values and then returns the control back to the client. The process of calling the external service has to be synchronous.
My problem is that this all works in a low load environment but when load gets high then we start queueing multiple requests, the WCF service starts timing out. We have set the "sendTimeout" property for the binding to 5 seconds and it times out after that.
I've tried replacing the external service with a mocked out local version and that handles the load OK but on the same hand the call to external service on it own is very quick - around 0.5 second. I can only presume that the timeouts are happening because too many requests were queued and WCF service couldn't respond within those allocated 5 seconds.
I have tried the following:<ul><li>Set the values of maxConcurrentCalls, maxConcurrentSessions & maxConcurrentInstances to very high numbers</li> <li>Set the value of system.net - connectionManagement - maxconnection to a very high number</li> </ul>
Does any one have any ideas about what we can do in this scneario?Answer1:
does your cpu peak during these high load times ? if not then you might be running out of threads. Make your wcf service that receives the original call asynchronous, and then call the external service asynchronously.
you will have to use asnyc pattern throughout your call chain to make sure nothing is blocking the thread.
<a href="http://msdn.microsoft.com/en-us/library/ms731177.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms731177.aspx</a>