Sat, 20 Feb 2016 20:06:57 +0100 Federico Giannici <giann...@neomedia.it>
> In a server (OpenBSD amd64 5.7) with many concurrent perl programs that 
> have to open a lot of SSH connections, I get many errors like this:

Have you tried connection sharing with ssh(1) yet?  Does the Net:SSH
give you this?

>      connect() on closed socket GEN136 at 
> /usr/local/libdata/perl5/site_perl/Net/SSH/Perl.pm line 216.
> 
> Maybe at some point no more sockets can be opened because of some limit 
> is reached?
> 
> I already tried to set these in sysctl.conf:
> 
>      kern.maxfiles=20000
>      kern.somaxconn=1024
> 
> And set this in login.conf:
> 
>      openfiles-cur=1024
> 
> But it didn't solved.
> 
> Any suggestion of what a can look at?

You could start simple and then advance to the complete programmatic
solution.  Possibly, but not necessarily limited to these:

ssh(1) connection sharing
ksh(1) ulimit
login.conf(5)

Maybe just then work on the eventual Perl related issues after you
confirm you can achieve the desired results with plain shell commands,
one liner (scripts) and direct ssh client connect using connection
sharing.

Reply via email to