how to speed up OpenSSH command execution (and a speed analysis)

Christoph Anton Mitterer calestyo at scientia.net
Mon Mar 26 08:38:41 EST 2012


On Sun, 2012-03-25 at 23:27 +0200, Ángel González wrote:
> Maybe your nrpe command behaves differently if it is run with a
> pseudo-terminal ?
For me, it happens not just with the nagios commands, but also when I
e.g. execute "true" remotely.


> What are the results when you employ a different command?
I just tried this:
~/.ssh/config has about:
ControlMaster auto
ControlPath something
ControlPersist yes

When I run
# time ssh nagtest at host.example.org true

First time: 0.169s
Subsequent times: ~0.044s


When I run
# time ssh -t nagtest at host.example.org true

First time: 0.132s
Subsequent times: ~0.007s

Actually, already the first invocation is faster (for me) when -t is
used.


> I get about 0m0.008s for the non-tty case and 0m0.009s with -t
> (with some deviations, there are -t of 0.008s and yet in some cases it
> is up to 0.011s)
> which is consistent with the fact that it needs to do more work when
> allocating a tty.
Strange,.. I cannot reproduce this, for me it seems to be always
relevant whether I use -t or not.


> > but directly afterwards, ssh prints the following on stderr:
> >    Shared connection to host.example.org closed.
> Call the client ssh with -q parameter to remove this diagnostic.
I've thought about that, too, and actually it works,.. but don't I throw
away "useful" warnings with this?


Cheers,
Chris.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5677 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20120325/68613946/attachment-0001.bin>


More information about the openssh-unix-dev mailing list