lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Quoth Alexander Gladysh <>, on 2010-10-16 22:13:46 +0400:
> Now, I've come to the point where reistablishing ssh connection for
> each command costs too much time.
> I wonder, if there is a way to safely reuse the connection?

Doing this sort of thing one has to be very careful about
synchronization and I/O buffering to avoid deadlock, and unless your
environment is very well set-up for it you can get a complexity and/or
unreliability spiral.

It may be that the easiest way to handle this is externally: with
OpenSSH, at least, you can start a persistent background SSH that
keeps a ControlMaster socket open, and then each subsequent SSH
process will connect up to the original SSH connection.  This is still
higher overhead than using a single SSH process, but it's better than
setting up and tearing down the remote connection every time.

   ---> Drake Wilson