[paramiko] scp not sftp
Robey Pointer
robey at lag.net
Tue May 29 09:47:34 PDT 2007
On 23 May 2007, at 10:57, Rafael Ugolini wrote:
> James Bardin wrote:
>>
>>> By the way, you should be able to change this line:
>>>
>>> chan.sendall("%s" % ( f.read()))
>>>
>>> to this:
>>>
>>> chan.sendall(f.read())
>>>
>>>
>>
>> of course you may also want to add some sort of buffer, maybe
>> something like:
>>
>> s = f.read(32768)
>> while s:
>> chan.sendall(s)
>> s = f.read(32768)
>>
>> Robey,
>> Would you have an idea why I can get full 100Mb/s transfers with
>> scp, but only 50-70% of that with sftp? What kind of extra work is
>> sftp doing?
It's almost certainly the round-trip latency. SFTP tends to send-and-
wait: it sends one chunk of a file, then waits for it to be
acknowledged. You can get around that by turning on prefetch or
pipelining.
> Robey,
>
> If you want, i can make a patch for paramiko, and you can put scp
> compatible with ssh version 1.
That would be cool!
It probably wouldn't be compatible with SSH version 1, though. SSH
v1 uses a different transport protocol. I guess what's happening is
that it's using scp v1 over an SSH v2 transport.
robey
More information about the paramiko
mailing list