locked
Understanding MaxConcurrentCalls RRS feed

  • Question

  • I've created an SOA service to run via HPC which, in turn, runs a third party application.  This application fails if there are more than two copies running concurrently.  To set 2 as the upper limit, I initially set the maxConcurrentCalls in the config file to 2 (session type is Core, worker node is an 8-core machine) and 8 calls seemed to hit the node concurrently (Looking at the task manager, you could see a third app try to start aside from the two active ones.  Log files show multiple attempts to open the application).  I have since modified the session start info to set both the minimum and maximum units to 1, left maxConcurrentCalls to 2 in the config file and now I'm seeing the behaviour I expect/want: maximum of two runs happening at any given time.

    I would like clarification on these two settings because I can't find any documentation indicating that they work in tandem.  Each call to the service only launches the application once (it may attempt to run serially if it fails initially) so there should ideally only be two active calls to the service at any given time.


    • Edited by KWilliams1 Monday, April 20, 2015 6:09 PM
    Monday, April 20, 2015 5:04 PM

Answers

  • Hi KWilliams1,

    The maxConcurrentCalls in the service registration file means the maximum number of messages actively processing across a service host. A value of 0 indicates that the maximum should be automatically calculated based on the service capacity (number of CPU cores) of each service host. (https://msdn.microsoft.com/en-us/library/ff943786%28v=WS.10%29.aspx). The configuration would eventually apply to the WCF ServiceThrottlingBehavior.MaxConcurrentCalls property.

    Note in HPC Pack, the SOA job would start the service hosts based on job resource type and max/min settings. If you specify maxConcurrentCalls as 2, and SOA job resource type is Core with max/min 8/8, and the compute node has 8 cores, then when the SOA job is running, there would be 8 tasks/service hosts running in the job, and 8*2=16 concurrent calls are processsing on the node. So if you would like to limit to only 2 application instances/SOA calls on a node, you may need to switch the job resource type from Core to Node, and keep the maxConcurrentCalls as 2.

    Last but not least, when specifying maxConcurrentCalls > 1 and if the WCF service behavior InstanceContextMode = InstanceContextMode.Single (by default it is PerSession), we also need to set the service behavior ConcurrencyMode = ConcurrencyMode.Multiple to let concurrent calls run.

    Best,

    Yutong

    • Marked as answer by KWilliams1 Tuesday, April 28, 2015 4:48 PM
    Tuesday, April 21, 2015 5:57 AM

All replies

  • Hi KWilliams1,

    The maxConcurrentCalls in the service registration file means the maximum number of messages actively processing across a service host. A value of 0 indicates that the maximum should be automatically calculated based on the service capacity (number of CPU cores) of each service host. (https://msdn.microsoft.com/en-us/library/ff943786%28v=WS.10%29.aspx). The configuration would eventually apply to the WCF ServiceThrottlingBehavior.MaxConcurrentCalls property.

    Note in HPC Pack, the SOA job would start the service hosts based on job resource type and max/min settings. If you specify maxConcurrentCalls as 2, and SOA job resource type is Core with max/min 8/8, and the compute node has 8 cores, then when the SOA job is running, there would be 8 tasks/service hosts running in the job, and 8*2=16 concurrent calls are processsing on the node. So if you would like to limit to only 2 application instances/SOA calls on a node, you may need to switch the job resource type from Core to Node, and keep the maxConcurrentCalls as 2.

    Last but not least, when specifying maxConcurrentCalls > 1 and if the WCF service behavior InstanceContextMode = InstanceContextMode.Single (by default it is PerSession), we also need to set the service behavior ConcurrencyMode = ConcurrencyMode.Multiple to let concurrent calls run.

    Best,

    Yutong

    • Marked as answer by KWilliams1 Tuesday, April 28, 2015 4:48 PM
    Tuesday, April 21, 2015 5:57 AM
  • Thanks for pointing me in the right direction.  I modified the DLL and am able to limit the number of parallel calls.

    However, a question related to this: is there something in the overhead of HPC that further limits the number of concurrent runs of software via COM?  I ask, because every time I run the software via HPC, there are COM errors when trying to run more than 2 copies of the application. However, when running via console and reproducing the HPC code to run on a single machine, I have run up to four copies of the same COM application without issues (I have not tired more in deference to resource issues but I would imagine it could go further).

    Thursday, April 23, 2015 9:34 PM