Parallel Loop Task

Overview

Parallel Loop Task is SSIS Control Flow task, which can execute multiple iterations of the standard Foreach Loop Container concurrently. In tests, a CPU intensive sequential process when executed in parallel on 4-core machine was executed 3 times faster compared to the sequential.

Setup

Use the General page of the Parallel Loop Task Editor dialog to configure the options needed to execute loop in parallel.

Options

Name

Specify task name.

Description

Specify task description.

StopOnFailure

Specify whether the Parallel Loop Task terminates if parallel execution fails.

PackageConnection

Specify package connection.

ForEachLoop

Type the Foreach Loop you want executed concurrently, or click the browse button (…) and locate it. You have to disable the target loop because the loop execution will be done by the Parallel Loop Task.

MaxExecutables

Specify the number of threads to use for concurrent execution. A value of -1 allows the maximum number of concurrently running iterations to equal the number of processors plus two. The specified value is also constrained to be equal or less than the Packages' MaxConcurrentExecutables property.

Considerations about Foreach Loop iteration variable

It is mandatory to use iteration variable scoped inside the loop container. Failure to do this will result in errors and/or concurrency issues.

How to setup dynamic loop connection?

Follow the steps below to setup dynamic iteration-variable dependent connection:

  1. Create a variable with the package scope and use this variable in the connection manager to construct your expression.
  2. Create a new variable with the same name and type, but with the loop scope.

The Parallel Loop Task will use the variable with the loop scope to evaluate the connection manager expression and build the dynamic connection.

Samples

  • For a sample demonstrating concurrent compression with CozyRoc Zip Task, check this package. The package contains loops, demonstrating both variable and connection iterations.