[ 
https://issues.apache.org/jira/browse/SSHD-1067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17186655#comment-17186655
 ] 

Lyor Goldstein commented on SSHD-1067:
--------------------------------------

There are major improvements to SFTP - but you need to switch to version 2.5.1. 
See the discussion in  SSHD-1049 and also the code in 
[SftpPerformanceTest|https://github.com/apache/mina-sshd/blob/master/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpPerformanceTest.java]
 and 
[SftpTransferTest|https://github.com/apache/mina-sshd/blob/master/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/SftpTransferTest.java]
 for examples how to use the improvements. Basically, the idea is to create an 
{{SftpFileSystem}} and then use {{Files.copy(...)}}

{code:java}
try (ClientSession session = createClientSession();
       SftpFileSystem fs = 
SftpClientFactory.instance().createSftpFileSystem(session)) {
    Path remoteFile = fs.getPath("/some/remote/path");
    Path localFile = Paths.get("/some/local/path");

    Files.copy(remoteFile, localFile);  // download
    Files.copy(localFile, remoteFile); // upload
}
{code}

Another option is to use {{SftpRemotePathChannel#transferTo}} as shown in 
[SftpRemotePathChannelTest|https://github.com/apache/mina-sshd/blob/master/sshd-sftp/src/test/java/org/apache/sshd/sftp/client/impl/SftpRemotePathChannelTest.java]

> Performance tuning parameters for Apache mina SSHD 2.4
> ------------------------------------------------------
>
>                 Key: SSHD-1067
>                 URL: https://issues.apache.org/jira/browse/SSHD-1067
>             Project: MINA SSHD
>          Issue Type: Question
>            Reporter: lakshmi Priya
>            Priority: Major
>
> We are using SSHD Mina 2.4 version, we are noticing that large file 
> upload/downloads are taking a very long time as compared to other libraries. 
> Are there any parameters that can be used to tune the performance for SFTP 
> server and client. Please suggest.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to