0

I have a WCF Application with two endpoints and five web services. In order to authenticate my WCF Application, a call is made to another web service. After authentication my application calls another web service, depending on the type of request. The issue is that for each incoming request my WCF Application calls at least two different web services. The recent number of incoming requests increased and caused the consumer to receive a Timeout error. My CPU utilization barley reached 10%. I've increased the maxconnection attribute in my Web services.

I separated my endpoints to two web sites. It increased the throughput to be processed ( and it almost solved the Timeout problem). However, I guess that there is a limit on the outgoing requests on IIS for each web site. If there is, what is it, and how can I increase it?

Note: I have another problem here and i guess both these problems Originating from one thing.

Community
  • 1
  • 1
Mohammad
  • 2,724
  • 6
  • 29
  • 55
  • Have you determined what the bottleneck actually is? – stuartd Jul 10 '16 at 10:59
  • yes. as i mentioned i think number of outgoing requests is limited for each web site. rather than this i don't see another reason. – Mohammad Jul 10 '16 at 11:03
  • 1
    Did you take a look at the `[ConcurrencyMode](https://msdn.microsoft.com/en-us/library/system.servicemodel.concurrencymode(v=vs.110).aspx)` of your service? Maybe you are handling the client calls one by one? – Jesse de Wit May 19 '17 at 05:26
  • i didn't change the default value. how can i change it? – Mohammad May 19 '17 at 05:27
  • I failed to edit the link in above comment due to a failing Edge browser on Windows Phone. – Jesse de Wit May 19 '17 at 05:37

1 Answers1

2

Maybe changing the ConcurrencyMode of your WCF service can help you. Just add the attribute to your service behavior. You will have to make sure that your code is thread-safe though, since this will make your application multi-threaded.

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
public class MyService : IMyService
{
    // Implementation
}
Jesse de Wit
  • 3,867
  • 1
  • 20
  • 41