Each automated Workflow Step/Activity in Straatos queues and processes tasks in parallel. However not all tasks that are queued in a step/activity are processed at the same time. Straatos manages the throughput of each automated step/activity by adjusting the number of “ready-for-process” tasks and number of processing threads in parallel by “throttling. .
Both these parameters are configurable by configuring the “number of instances” and “number of threads” parameter in a workflow step/activity.
When an automated service task is used to send information and data to an external service, and that receiving service has a limit to the amount of tasks it can accept and process. In this case, the number of tasks can be limited so the external service is not overloaded.
The throttle can be configured separately for each workflow step. In the Process Designer, click on an activity, then click on the 'Set maximum number of threads' icon.
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8zMzg1LzUwNDYvY2tmaW5kZXIvaW1hZ2VzL2ltYWdlKDYzKS5wbmciLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3NjU4NjAxMDF9fX1dfQ__&Signature=qKrQ9eCUHxS~DOdUZh0mZTCBkGhrSu7JrTtIiHP-OWhH5VaOjjEB5JPJng0X9E9sItjN4z7QeXV4Phct8lCuTVTrX8qUGi2pRR0ab0y7Rui7Q32i8teC0y3a8wYxxrSrQtF7D7DKg21dIoPC4jgs3ZRQuHbvMRGhhabUIpQJnmD026rkjqQWsZtOIJpUQdj1Dt3dm63fSmNfgRezKR6G4tmmeM80lBtvwY7r8cAK46v1pLy4vdNx7Y22iMmWLuxGIpIRqtZmWAiQVNbuAxhW5A5b98IX2~H2fU0fWokSUKbwuuVd7r48NhiBeRmANpMDX6qwNKdGhSr09oL9sbfpEQ__&Key-Pair-Id=K2TK3EG287XSFC)
In the pop up box, enter the settings:
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8zMzg1LzUwNDYvY2tmaW5kZXIvaW1hZ2VzL2ltYWdlKDY0KS5wbmciLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3NjU4NjAxMDF9fX1dfQ__&Signature=oBhLQciFcjMcvIrSkcaM8jlrBFKgMHcUesGX08Xk5LbRxfDq3duniF645wiLxJgC92zwm0LIFoBREhmkcX3Y4wP0YihcqoMFmQULg0P-jjjxslin5ASUBvkYMUmBLBgJsH4SNC8N~UxjsWpucQ9ssWewenz-z7jIZWpbvl5tatq0NAXPHuDNSPffGlQ51L0IA9jVSEPxgTFPnXkDCTFnLahcMXPmZa~-A5cukJscEvTUZKRtNxdx~-oWxXct6qftqTtAY8JCPimYqKD2optbik-kGSKB68eUKJftc-~uvh4Rv66mXev4mk6kGmdmt9H~ZJL39App9FTYmfgpehxgWg__&Key-Pair-Id=K2TK3EG287XSFC)
This throttle can be used if you want to limit the number of “ready-to-process” tasks in a particular workflow step. For example, in a very busy environment, there may be 1000 tasks (each tasks contained an image to be processed) queued in the automated workflow step/activity that is sending documents to a OCR cloud service. However, the OCR service can only accept 20 documents. Therefore if the parameter is set to 0 value, Straatos will attempt to send all 1000 tasks (images) to the OCR cloud service resulting in an error.
This limits the number of processing threads servicing a queue of tasks in a workflow step/activity. Threads works in conjunction with the number of instances (“ready-to-process” tasks ) configured in the throttle parameter.
For synchronous execution (for example in JavaScript steps), this has the same effect as limiting the number of instances (when throttle is set to 0 (no throttling)). By default this value is set to 10. (Number of configured processing threads should not be larger than the number of instances in any given situation).
In asynchronous processing (when a step/activity is not expecting a return result from the external service) , the workflow step will trigger 10 processing threads at a time and is ready for the next processing cycle once the last one has ended. . If the asynchronous service returns with the result, a processing thread from the configured number of thread pool is consumed to manage the incoming request. This helps to optimize the amount of computing resources used for each workstep and hence the ability to manage bottlenecks and maximise throughput. Most Straatos Service Tasks are processing documents asynchronously behind the scene and hence limiting the throttle will not affect the performance significantly, except for large number of tasks processed in parallel. In most cases, if limiting the tasks is required, the throttle option should be used.