Workflow Service stops responding after 464 messages

懵懂的女人 提交于 2019-12-11 01:04:10

问题


I am having a peculiar issue while executing workflows.
I have tried everything I could think of and now need ideas.

Here is my configuration:
1. A WF4 Workflow Service (xamlx) hosted in IIS 7 and uses net.msmq/netMsmqBinding for transport (MSMQ is transactional).
2. No Workflow Persistence is used.
3. I use a console app client to send messages to the workflow (each message creates new workflow). 4. Each workflow looks like: Wait for START message -> Wait for END message (I only send START messages).

If I send 500 messages - 464 get processed correctly, but above that all messages go to the lock_* queue and then move to poison queue. I have inspected Debug, Analytic event logs, as well as messages and trace svclogs Here is most detailed message I get:

System.TimeoutException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The 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.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult result) at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)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.PersistenceProviderDirectory.LoadOrCreateAsyncResult.HandleReserveThrottle(IAsyncResult result) at System.Runtime.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

at that point request to http://localhost/MyWebService?wsdl also fails with 404.

If I restart IIS - everything goes back to normal until 464 messages are sent.

  1. Where can I find more detailed log? (I already have System.Diagnostics set to max verbosity)
  2. Is number 464 magic at all?
  3. What can be causing this web service locking up?

回答1:


It sounds like you are running into the throttling limits, these settings apply to WF4 as much as they do to WCF. The maxConcurrentInstances setting sets the maximum number of workflow instances that can be in memory at a given time.

<behaviors> 
  <serviceBehaviors> 
    <behavior name="WorkflowServiceBehavior"> 
      <!-- Specify throttling behavior -->
      <serviceThrottling maxConcurrentInstances="1000"/> 
    </behavior>
  </serviceBehaviors>
</behaviors>

Just as an aside you should always use persistence when hosting in IIS. Sooner or later IIS is going to restart the AppDomain and if the WorkflowServicehost can't save the state of the workflow instances to disk they will be lost. It will also mean that idle workflow instances can be removed from memory and don't count against the maxConcurrentInstances which is an in memory restriction.



来源:https://stackoverflow.com/questions/9267921/workflow-service-stops-responding-after-464-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!