in reply to Re: Working around limit to number of connections vis Net::OpenSSH
in thread Working around limit to number of connections with Net::OpenSSH

Woot! You guys are friggin' geniuses. Open file limit on Mac is 256. I bumped to 512 and all is well. Thanks!

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

  • Comment on Re^2: Working around limit to number of connections vis Net::OpenSSH

Replies are listed 'Best First'.
Re^3: Working around limit to number of connections vis Net::OpenSSH
by salva (Canon) on Mar 28, 2017 at 07:35 UTC
    Looking at the code excerpt you have posted, it seems unlikely that you need the 256 files opened simultaneously. Probably, your code or some of the modules you are using or the OpenSSH binary is leaking file descriptors in some way.

    Increasing the available file descriptors is just going to hide and delay the issue but not to solve it.

    Net::OpenSSH has a debug mode you can enable setting $Net::OpenSSH::debug=-1, and you can also pass the flags -vvv to the ssh client in order to find where your program is failing.

      I agree. I'm just happy to figure out why the code wasn't working. Ideally I'd like for the new file objects to re-use an existing Net::OpenSSH object or destroy existing objects that use the connection. I'm currently trying to figure out how to do that.

      $PM = "Perl Monk's";
      $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
      $nysus = $PM . ' ' . $MCF;
      Click here if you love Perl Monks

        You should be able to reuse the Net::OpenSSH object/connection as many times as you like.

        AFAIK, nor the module, neither ssh leak file descriptors, so the issue is probably in your code...