Feature request: fsh-like functionality
Norbert Nemec
Norbert.Nemec.list at gmx.de
Fri Jul 23 18:50:05 EST 2010
On 23/07/10 00:13, Keisial wrote:
> Damien Miller wrote:
>
>> On Thu, 22 Jul 2010, Norbert Nemec wrote:
>>
>>> * Fast remote command execution
>>> Current timings:
>>> ssh otherhost echo hi -> 1.06 sec # regular connection
>>> ssh -f -N -M # setting up master
>>> ssh otherhost echo hi -> 0.86 sec # using master
>>> fsh otherhost echo hi -> 2.06 sec # this sets up the master
>>> fsh otherhost echo hi -> 0.096 sec # this uses the master
>>> Is there any fundamental reason for the 0.86 sec delay in a slave
>>> connection? After all - fsh demonstrates that the same thing can be
>>> done in less than 0.1 sec. This makes a significant difference for the
>>> applications that I have in mind.
>>>
>> I don't see this delay - opening a new mux slave is ~0.02 sec on my
>> host. Is your "otherhost" distant network-wise? Slave sessions incur
>> at least two round-trips between the client and the server, but if you
>> have port-forwards specified in your ssh_config then these will cause
>> additional delays. Closing channels is also more verbose in the SSH
>> protocol, though I don't think there is a round-trip there.
>>
> I see a small delay of 0.07s in ssh.
>
Hmm - based by these numbers I did some further test and am now
suspecting that it is actually the login process of the bash that is
eating up the time. Unfortunately, I cannot easily simplify the login
scripts as a number of modules needs to be loaded. Furthermore, it is
not quite clear to me which scripts are actually executed when calling
'ssh somehost "command"'. According to the documentation "command" is
executed instead of a login shell. Still, the .bashrc seems to be read.
If I understand it correctly, FSH effectively eliminates this overhead
by starting a login shell only once and running the remote command
processor within that shell with a fixed set of environment variables
set in the persistent shell.
Perhaps there is some way to re-use the environment from the mux master
to the mux slaves instead of re-evaluating .bashrc each time?
Greetings,
Norbert
More information about the openssh-unix-dev
mailing list