On Fri, Oct 28, 2005 at 01:02:51AM +1000, James Mills wrote:
> Hi,
>
> Got a performance issues here...
>
> ~/tmp/pyssh
> $ time ./uptime
> uptime
> 01:01:06 up 3 days, 15:01, 5 users, load average: 0.08, 0.10, 0.09
>
> prologic@earth
> Fri Oct 28 01:01:06
> ~
> $
>
> real 0m7.736s
> user 0m0.040s
> sys 0m0.020s
>
> See the attached "uptime" script. Based on your own test code.
>
> Here's the same thing with the openssh "ssh" command:
>
> ~/tmp/pyssh
> $ time ssh earth "uptime"
> 01:02:16 up 3 days, 15:02, 4 users, load average: 0.26, 0.13, 0.10
>
> real 0m1.393s
> user 0m0.016s
> sys 0m0.004s
Change ssh.login() to ssh.open(). Using login establishes an interactive
session, so you're timing until the session closes.
> Also notice that PySSH seems to open up a pty by default.
> Should it do this ? (ihmo, I think it shouldn't).
...
> Perhaps have in the constructor of Ssh
>
> def __init__(self, username, host, port, pty=False):
Patches welcome ;) The current version is little more than a wrapper around an
ssh pipe.
mwa
--
Mark W. Alexander
sl...@do...
The contents of this message authored by Mark W. Alexander are released under
the Creative Commons Attribution-NonCommercial license. Copyright of quoted
materials, if any, are retained by the original author(s).
http://creativecommons.org/licenses/by-nc/2.0/
|