Hey everyone,
I'm using commons-vfs (2.0-SNAPSHOT) to interact with JSch (0.1.42) and 
retrieve files via SFTP.

This is the configuration I do:

JSch.setLogger(new com.jcraft.jsch.Logger() {
        @Override
        public void log(int level, String message) {
                Logger.getLogger(JSch.class).info(message);
        }
        @Override
        public boolean isEnabled(int level) {
                return true;
        }
});
SftpFileSystemConfigBuilder builder = SftpFileSystemConfigBuilder.getInstance();
OPTS = new FileSystemOptions();
File sshDir = new File(System.getProperty("user.home"), ".ssh");
try {
        builder.setIdentities(OPTS, sshDir.listFiles(new KeyFilter()));
} catch (FileSystemException e) {
        LOG.fatal("Couldn't open private keys", e);
}
builder.setUserInfo(OPTS, new VFSUserInfo());
try {
        FSM = org.apache.commons.vfs.VFS.getManager();
} catch (FileSystemException e) {
        throw new IllegalStateException(e);
}

FileObject file = VFS.getManager().resolveFile("sftp://...";, OPTS);
File tempFile = File.createTempFile("vfsdownload", null);
tempFile.deleteOnExit();
FileObject newFile = VFS.getManager().toFileObject(tempFile);
IOUtils.copyLarge(file.getContent().getInputStream(), 
newFile.getContent().getOutputStream()));


Doing this, I'm observing transfer rates of approx 200KB/s.

If I run
scp u...@server:/file /tmp/dest
I get almost 2MB/s

Are there known ways to tune the SFTP implementation to go faster?  I can't 
live with such a dramatic slowdown...
Thanks in advance,
Steven Schlansker



------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to