[erlang-questions] ssh_sftp:read_file

Sean Cribbs <>
Mon Mar 17 14:56:42 CET 2014


If your goal is simply to transfer the file and not to actually read it in
your Erlang program, why not use os:cmd/1 to run the faster version?


On Mon, Mar 17, 2014 at 6:18 AM, József Bérces
<>wrote:

>  Comparing the ssh_sftp:read_file execution time to command line sftp
> shows a big difference. I experimented with a ~7MB gzipped file,
> downloading it from a Debian machine to my Win7 laptop. I tested it with
> Erlang R15B03, R16B02 and R16B03-1.
>
>
>
> While the Cygwin sftp transferred it in 4 seconds at 1.7MB/s speed,
> ssh_sftp:read_file got it in 30-20 seconds, depending on the erlang
> version. R16B03-1 shows improvement compared to the older releases, so it
> got the file in ~20s (the older ones needed ~30s).
>
>
>
> Writing a small program and using ssh_sftp:read to get the file in 64KB
> chunks speeds up the file transfer on all releases. The best I got with
> this is ~11 seconds on R16B03-1 (~20s on the older Erlang releases). But
> that is still far from the 4 seconds of the Cygwin command line sftp.
>
>
>
> Is there a way to further speed up the sftp file transfers in Erlang to
> reach (or at least to get near to) the command line sftp?
>
>
>
> Thanks,
>
> Jozsef
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
Sean Cribbs <>
Software Engineer
Basho Technologies, Inc.
http://basho.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140317/39744d1e/attachment.html>


More information about the erlang-questions mailing list