none
Max concurrent calls to WCF service RRS feed

  • Question

  • We have a wcf service hosted in IIS (Win 2012). We expect thousands of messages coming throughout the day, however the peak would be around 4K concurrent messages. All these are async requests and wcf service performs some processing which will take several seconds for each request. - Is there any limitations on max concurrent requests that can be sent to wcf svc hosted on IIS? Does it depend on thread availability on server? Any settings that needs tweaking would be useful.

    In another scenario, we have less number of async requests coming to wcf svc, however for each request service performs few things parallely (Parallel.ForEach). What would be maximum parallel threads available in this scenario and does it depend on any other factors? Any settings that needs tweaking would be useful.

    Saturday, June 13, 2015 2:42 AM

Answers

  • Hi btsdotnet ,
       As per  this case, I have shared the corresponding details :
    1. The default value of Maximum concurrent calls for  WCF throttling is 26  .
    You can limit this based on your requirement like below :

    <serviceBehaviors> 
    <behavior name="serviceBehavior"> 
     <serviceThrottling maxConcurrentCalls="16"
          maxConcurrentInstances="2147483647" maxConcurrentSessions="10" /> 
    </behavior> 
    </serviceBehaviors>
    

    2.For handling Multiple threads with clients, its based on InstanceContextMode

    3.if you use PerCall InstanceContextMode,  it creates different instance for different calls, and they are invoked in different threads

    4.if you use PerSession InstanceContextMode, it creates Multiple instance per client

    5.According to your case, Parallel.forEach is not necessary. It will be done by server side.

    For more information, Click here to refer about WCF Concurrency in detail.

    • Marked as answer by btsdotnet Thursday, June 18, 2015 6:00 AM
    Monday, June 15, 2015 9:05 AM