开发者

WCF Service calling an external web service results in timeouts in heavy load environment

开发者 https://www.devze.com 2023-04-11 06:14 出处:网络
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

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:

  • Set the values of maxConcurrentCalls, maxConcurrentSessions & maxConcurrentInstances to very high numbers
  • Set the value of system.net - connectionManagement - maxconnection to a very high number

Does any one have any ideas about what we can do in this scneario?


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.

http://msdn.microsoft.com/en-us/library/ms731177.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号