13

I have a WCF service (basicHttpBinding) hosted in II7 on Vista that I expect to handle many requests concurrently. I'm attempting to load test the service by spawing 200 threads in a test app and calling the WCF service. I've run this test app on the same machine as the server as well as multiple other computers and I always get the same result - no more than 5 workers are used. Is this a WCF, HTTP or IIS bottleneck?

James Cadd
  • 12,136
  • 30
  • 85
  • 134

4 Answers4

11

This is a feature to prevent denial of service attack. Out of the box, WCF is designed to be secure. Check the service behavior, look in msdn for maxConcurrentCalls and maxConcurrentSessions configuration. I think the limit is 10, but I could be wrong.

  • 2
    This is the closest answer - if I changed maxConcurrentCalls the number of WCF workers actively reflects that value, to a point. Anything over 10 doesn't actually run more of my workers. Strangely, the default is 16 but I can't get 16 calls to be active at the same time. – James Cadd Mar 26 '09 at 18:54
  • 2
    The default limit is 16 not 10. Btw 0x10 is 16 :) – Vadym Stetsiak Sep 02 '10 at 12:19
  • MS says the default for sessions is 10 in .NET 3.5, 100xprocessor in 4.0+. http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentsessions(v=vs.90).aspx – Nick Gotch Jun 14 '13 at 19:09
3

No, it's just the default throttling settings in WCF. It's configured in the serviceThrottling element of a behaviour in the service config file, which has a maxConcurrentSessions attribute. Default 5, but you can set it to whatever you want.

David M
  • 71,481
  • 13
  • 158
  • 186
2

WCF is secure by default. This means that the default settings limit what you can do with your WCF service to avoid things like denial of service attacks. This is great for internet facing web services, but it can sometimes bite you. Depending on what bindings and behaviors you use, it could be a setting in any of those.

Here is an overview of these settings - it'll require some experimentation on your part to determine what exactly is biting you.

Kurt Schelfthout
  • 8,880
  • 1
  • 30
  • 48
0

As of .NET 4.5, the default number of connections is (100 * number of processors) - ServiceThrottlingBehavior.MaxConcurrentSessions Property

Dave Black
  • 7,305
  • 2
  • 52
  • 41