Skip to main content

Best practices on Load balancing with Subprocesses

Integration development

Ossi Galkin avatar
Written by Ossi Galkin
Updated over a year ago

Load balancing with Subprocesses

In some cases it is necessary to execute heavy operations in a Process to complete one integration. For example, you need to read and process data from files which are in a different format, such as CSV, JSON or XML files. Since these operations don't have dependencies between each other, you decide to run these steps in parallel. If the files are big, it generates a load to the Agent which might cause the Agent to crash. In this case it would be a good idea to share the load of these operations with other Agents. This can be done using Remote Subprocesses.

You can create a Subprocess for each of the data processing steps and then call those Subprocesses remotely from the main Process. After all of these Subprocesses are finished, you can use the data generated by all of them in the main Process. To enable this, you need to have multiple Agent Groups in one Environment, since you cannot call Subprocesses remotely between Environments, only between Agent Groups in an Environment. When execution of the main Process starts, the Process will trigger the Subprocesses in parallel in other Agent Groups and waits until those Subprocesses are finished before moving forward. This way you can move the heavy lifting of data to other Agents, so one Agent doesn't have to take care of everything.

It should be noted that Remote Subprocesses are triggered using a Service Bus, so moving a lot of data between Agent Groups might cause some latency in the Process. Hence, you should only return the necessary data from a Remote Subprocess to a calling Process to minimize the risk of causing latency in the whole Process.

The next article is the beginning of the API Development course Introduction to What is needed for creating an API

Did this answer your question?