Workflows -- Parallel Throttle Limit?

This topic contains 4 replies, has 4 voices, and was last updated by  Lax 1 month, 2 weeks ago.

  • Author
    Posts
  • #10627

    Ian Douglas
    Participant

    I just started using the new workflow construct in posh, and I'm wondering if there's a way to specify a 'throttle limit' ( or something similar) parameter in the parallel blocks so that only x-number of simultaneous instructions get executed at once. For example, i would like to limit the following file copies to 32 nodes at a time:

    workflow Distribute-Directory
    {
    [CmdletBinding()]  
    Param
    (
    $dir_source = 'C:\TEMP\_packages\Intel-825xx-Gigabit-Ethernet-Controller',
    $dir_dest = 'c$\temp',
    [string[]]$node
    )

    Foreach -parallel ($node_dest in $node) {

    cmd /c robocopy $dir_source $("\\"+$node_dest+"\"+$dir_dest+"\"+(get-item $dir_source).Name) /E

    }

    }

    Many thanks!

  • #10628

    Don Jones
    Keymaster

    That was added as a feature in v4, I believe.

  • #49694

    shawn bequette
    Participant

    Can anyone confirm/deny that the parameter -Throttlelimit works above 5?
    ex.
    ForEach -Parallel -ThrottleLimit 10 ( $database in $databases )

  • #49700

    Don Jones
    Keymaster

    Shawn – be sure to start a new thread for a new question; I almost missed your reply, here.

    The WWF engine handles the throttling; you can specify an upper limit, but the engine doesn't have to use as many threads as you specify.

  • #74347

    Lax
    Participant

    Any alternate or substitute to overcome the default throttle limit(5) or more than 5 ?

You must be logged in to reply to this topic.