Welcome Guest! Log in


This article shows how to control how many sessions can run at the same time for a given delivery.

The method

It is possible to limit the number of parallel executions of a process by setting the property nbMaxParallelSessions in the Meta-Inf of the Process.

This parameter limits the number of parallel executions for a given Delivery, within a given Runtime. The other sessions are queued by this Runtime and they will start progressively as the previous sessions end.

The sample process

For this example, we have a child process, which can last a random duration between 1 and 30 seconds.

01-child

Expression of the SLEEP_DELAY = %e(rhino){(1000*Math.floor(1+Math.random() * 30)).toString()}e(rhino)%

Notice the Property "Meta-Inf" : <nbMaxParallelSessions>10</nbMaxParallelSessions>

This property will prevent this process from being executed more than 10 times in parallel.

 

 

The main process has a SqlOperation which retrieves 35 rows from a table.

The bound action executes the "parallel-child" delivery in "Asynchronous mode".

02-main

 

 

Execution

Here is what happens when executing the "parallel" process :

03-exec

 

All the necessary sessions are prepared.

The Runtime executes these prepared sessions, but "holds" them so that there is no more than 10 sessions at the same time.

 

Comments  

# Nicolas.Duret 2017-10-04 17:44
Hello,

Are you sure about the fact that the Runtime checks for already running sessions for "the same delivery" only?
If I have two completely different deliveries having both "nbMaxParallelSessions set to 1", then it is impossible to have both deliveries running at the same time on the same runtime.
I was expecting to be able to use this setting to prevent the same delivery to execute in parallel (with itself), but keep the possibility to run different deliveries in parallel.
Any other ways to achieve this?

Kind Regards,
--
Nicolas.
# Thomas BLETON 2017-10-05 09:37
hi Nicolas, yes I can confirm the normal behavior: nbMaxParallelSessions applies to the current delivery. Other deliveries will start normally. If you encounter an issue please open a support ticket with more details :-)
# Nicolas.Duret 2017-10-05 12:32
In facts, when differents deliveries are executed in parallel with ExecuteDelivery objetcs within the same process, it works as expected and as explained above.

But if two different deliveries are run manually or scheduled almost at the same time (so run separatly), then the second delivery wait for the end of the first one.

Support ticket with more details created ;-)

You have no rights to post comments

Articles

Suggest a new Article!