SevOne

 View Only

Can you use parallel processing in IBM Rapid Network Automation workflows?

By Tim Greenside posted Mon April 08, 2024 05:34 PM

  

Recently I was asked if IBM Rapid Network Automation could make use of threads to perform parallel processing within a workflow.  The answer is "YES!!".  Maybe you want to kick off an upgrade on 15 switches simultaneously during a maintenance window.  

So, how does one add that behavior into a workflow?  Here's a simplified example:

IBM Rapid Network Automation is a low-code/no-code automation solution.  It ships with an expansive library of function and API end-point "action blocks" that can be dragged-and-dropped onto a workflow canvas, allowing you to quickly construct workflows to accomplish redundant tasks.

To demonstrate the parallel processing capability, I'll use one of the "action blocks" from the "Common" set of available blocks entitled "ForEachParallel".

The "ForEachParallel" block allows us to provide an array and a concurrency where we can tell it how many items in the array we should process at the same time.

  • Our demonstration will make use of an array of 15 items = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].
  • We will initially set our concurrency = 1, which will cause each array item to be processed one-at-a-time... not very parallel now is it...  :D
  • The workflow will sleep for one second between concurrent iterations.
  • We will capture the start and end of the workflow to see how long it took to complete all iterations.

Since we chose to use a concurrency setting of "1", we got what we paid for...  15 seconds to complete the workflow (process 15 items, one at-a-time, sleeping for 1 second between concurrent runs).

We can do better!  Now let's change the concurrency to "5" so that we process 5 at a time.  

Much better!  A concurrency setting of "5" rendered a 3 second result to complete the workflow (process 15 items -- 5 at-a-time, sleeping for 1 second between concurrent runs).

Now for the big finish!  Let's set the concurrency to "15":

A concurrency setting of "15" rendered a 1 second result to complete the workflow (process 15 items -- 15 at-a-time, sleeping for 1 second between concurrent runs).

So you can see for yourself the value of parallel processing --  rather than processing items concurrently, you can process in parallel when the situation calls for it.

1 comment
23 views

Permalink

Comments

Mon April 08, 2024 06:08 PM

Awesome, Tim! … I can see a number of use-cases for Parallel Processing already.