locked
WorkflowServiceHost: Limitation in the number of running instance? RRS feed

  • Question

  • Hi

    The WorkflowServiceHost stops responding after 232 created workflowinstances.

    I used the CreationEndPoint Project  from the Smaples in WF_WCF_Samples\WF\Basic\Execution\CreationEndpoint\CS\CreationEndpoint. (for simplicity, same behavoir in other projects)

    IWorkflowCreation client = new ChannelFactory<IWorkflowCreation>(creationEp.Binding, creationEp.Address).CreateChannel(); 
    int i = 0;
    while (true)
    {
      client.Create(
    null);
     
    Console.WriteLine("{0}", i++);
    }

    After 232 loops the Create call fails, with the exception:

    System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The operation did not complete within the allotted timeout of 00:00:30. The time allo
    tted to this operation may have been a portion of a longer timeout. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaul
    ts=true, whose value is:
    System.TimeoutException: The operation did not complete within the allotted timeout of 00:00:30. The time allotted to this operation may have been a portion of
    a longer timeout.
       at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.ControlOperationAsyncResult.End(Object[]& outputs, IAsyncResult result)
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(MessageRpc& rpc)
       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)).

     

    The Workflow Activity is in an endless loop with a Delay Activity configured to 5 minutes. (simulation of long running activities, normally blocking on MessageReceive or Bookmark).

    Is there a configuration property to change this behavior?

    I tried: serviceThrottling ServiceBehaviors

    this is the workflow executed:

     Sequence workflow = new Sequence
    {
                   
        DisplayName = "CreationService",
                   
        Activities =
        {
            new While
            {
                    Condition =  true,
                    Body   =
                    new Sequence
                    {

                        Activities =
                        {
                        new WriteLine
                        {
                            Text = "Hello World"
                        },
                        new Delay
                        {
                                Duration  = TimeSpan.FromMinutes(5)
                        }

                        }                               
                    }
            }
        }
    };

    thanks.

     

    Sunday, May 23, 2010 7:39 AM

Answers

  • ServiceThrottlingBehavior has a MaxConcurrentInstances property, which you can set.

    If you don't set it, it uses MaxConcurrentCalls + MaxConcurrentSessions for the value of MaxConcurrentInstances.

    But if you don't have a ServiceThrottlingBehavior, it uses some defaults. The default MaxConcurrentCalls value of 16. The default MaxConcurrentSessions value of 100. But it multiplies each of these by OSEnvironmentHelper.ProcessorCount.

    So, if you have a processor count of 2, you get 16 * 2 + 100 * 2, or 232 for a value of MaxConcurrentInstances.

    Wednesday, June 9, 2010 12:05 AM

All replies

  • WorkflowServiceHost use WCF, so  it must have a limit number for service instance.

    for any call of WCF service in Client, you must close or dispose the wcf proxy instance.


    Sunday, May 23, 2010 1:58 PM
  • Thanks

    I tried, but I seems to be at the server side.

    I created a sublcass from ClientBase:

    using(MyClient c = new MyClient(binding,address))
    {
       c.Call();
    }

    The same behavoir.

    Monday, May 24, 2010 11:25 AM
  • ServiceThrottlingBehavior has a MaxConcurrentInstances property, which you can set.

    If you don't set it, it uses MaxConcurrentCalls + MaxConcurrentSessions for the value of MaxConcurrentInstances.

    But if you don't have a ServiceThrottlingBehavior, it uses some defaults. The default MaxConcurrentCalls value of 16. The default MaxConcurrentSessions value of 100. But it multiplies each of these by OSEnvironmentHelper.ProcessorCount.

    So, if you have a processor count of 2, you get 16 * 2 + 100 * 2, or 232 for a value of MaxConcurrentInstances.

    Wednesday, June 9, 2010 12:05 AM
  • Hello Brother,

    Did you find the resolution of this problem? I am have exact same problem. Thanks in advance.


    sans
    Friday, October 28, 2011 3:14 AM
  • any resolution for this case, having the same thing over here

    Noor

    Monday, August 26, 2013 4:14 PM