in reply to Re: ssh output is partial when using fork manager
in thread ssh output is partial when using fork manager

Hello all, Thanks for your feedback. I tried to minimize the number of processes running at the same time by introducing a delay in the loop before spawning a new process. This way the total number of parallel processes running would be less, since some would have finished before others start. It made my script a bit slower but I had zero failures.
  • Comment on Re^2: ssh output is partial when using fork manager

Replies are listed 'Best First'.
Re^3: ssh output is partial when using fork manager
by salva (Canon) on Jan 26, 2018 at 09:05 UTC
    But that is precisely what Parallel::ForkManager is for!

    You tell it how many processes to run concurrently when you create the object and then it takes care of never running more than so many processes, delaying the start calls as necessary.

Re^3: ssh output is partial when using fork manager
by salva (Canon) on Jan 26, 2018 at 09:10 UTC
    You can also go for Net::OpenSSH::Parallel which knows how to handle most of the issues you are facing by itself.

      A code example of Some people find easier to use Net::OpenSSH combined with Parallel::ForkManager, threads or Coro. would be handy. hint hint ;)

      Jason L. Froebe

      Tech Blog