<div dir="ltr">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?</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Mar 17, 2014 at 6:18 AM, József Bérces <span dir="ltr"><<a href="mailto:jozsef.berces@ericsson.com" target="_blank">jozsef.berces@ericsson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Jozsef<u></u><u></u></p>
</div>
</div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Sean Cribbs <<a href="mailto:sean@basho.com" target="_blank">sean@basho.com</a>><div>Software Engineer</div><div>Basho Technologies, Inc.</div><div><a href="http://basho.com/" target="_blank">http://basho.com/</a></div>
</div>