mina-sshd icon indicating copy to clipboard operation
mina-sshd copied to clipboard

Performance Disparity Between Apache Mina and JSCH

Open VHelpYou opened this issue 1 year ago • 2 comments

Version

2.11.0

Bug description

We are currently transitioning from using JSCH to Apache Mina for our SFTP calls. My application requires high scalability and performance, as it handles teh transmission over 50,000 files totaling 5 TB in size. Previously we utilized JSCH but we have now adopted to Apache Mina. However, we have observed the degradation in the throughput of file transmission.

Actual behavior

We noticed Approximately 3 to 4 X times slowdown in Apache Mina compared to JSCH. However, I'm unsure if there are other factors contributing the to the issue. I'm curious if there have been any parallel benchmarking or testing conducted to similar style. On a side note, we are expecting logging is set to DEBUG and that is contributing to some slowness.

Expected behavior

We expected Apache mina is much faster than any older sftp java libraries.

Relevant log output

No response

Other information

No response

VHelpYou avatar Mar 19 '24 20:03 VHelpYou

Why should a newer library be much faster? It's the same protocol. If both are programmed correctly, they should have about the same performance.

My local tests show that with INFO logging Apache MINA SSHD has about the same performance for uploads and downloads of small or large files as JSch, and both are competitive with OpenSSH. In all three timing is linear with file size.

DEBUG logging does slow down things quite a bit. In particular I would expect Apache MINA SSHD to log much more than JSch.

It's not a good idea to run a production application with DEBUG logging on by default.

tomaswolf avatar Mar 29 '24 18:03 tomaswolf

Also see #485. The transfer speed may also depend on how exactly your code transfers files.

tomaswolf avatar Apr 16 '24 23:04 tomaswolf

Closing this. If AES encryption was used, the slowness can be explained and should be fixed with the fixes made for issue #524.

tomaswolf avatar Jul 16 '24 21:07 tomaswolf