MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

Much slower SFTP transfer speed

Open SodaWithoutSparkles opened this issue 2 years ago • 6 comments

I have switched from ES file explorer to Material files for a few months, And I realize theres a significant difference in file transfer speed.


Test environment: SSH server

  • Raspberry Pi 4B 2GB ram
  • Ethernet connection
  • 240GB SSD less than half filled
  • OpenSSH_8.4p1 Debian-5+deb11u1, OpenSSL 1.1.1n 15 Mar 2022

Test file: a 448MB .ts video file


Material files starts slow at about 500KB/s, as indicated by the system network activity (theres no transfer speed in the notification, just transfered/total infomation). Then raised the speed to about 2 MB/s. I have waited until the number settles. The system network activity meter has a refresh interval of about 5 seconds

Screenshot_2023-01-01-17-27-30-070_me.zhanghai.android.files-edit.jpg


On the other hand, ES file explorer has a transfer window stating the file transfer was done at 52MB/s. The system network activity meter agreed with it, saying that it was transfering at about 54MB/s. IMG_20230101_174148.jpg


And I have confirmed the speed by using termux and sftp. Also >45 MB/s IMG_20230101_175149.jpg


For download speeds, theres also quite a difference. Screenshot_2023-01-01-18-03-23-336_me.zhanghai.android.files-edit.jpg IMG_20230101_180053.jpg IMG_20230101_180021.jpg

  • Material files: N/A, system: 4.6MB/s
  • ES file explorer: 55MB/s, system: 59.8MB/s
  • Termux sftp: 47MB/s, system: 57MB/s

Material files transfer at 2-5MB/s fluctuating, but never reaches above 10MB/s

Why is there such a difference?

SodaWithoutSparkles avatar Jan 01 '23 09:01 SodaWithoutSparkles

The slow transfer speed also makes the thumbnail loading speed VERY slow, especially if the directory contains a lot of images.

SodaWithoutSparkles avatar Jan 01 '23 10:01 SodaWithoutSparkles

I don't know either, and I actually don't use the SFTP functionality myself - it was added on user request. The functionality is implemented with sshj and its default configuration, so one is welcomed to figure out what needs to be improved.

zhanghai avatar Jan 01 '23 10:01 zhanghai

  1. Is the file transfer in Material Files to SFTP server multi-threaded?
  2. And is the request done using scp or sftp?
  3. Is there any way for users to disable compression?
  4. Any plans on having an "advanced mode" where every settings (of SSHJ) can be tweaked?

中文我也看得懂,你希望的話我可以用中文


UPDATE: after reading https://github.com/hierynomus/sshj/issues/688, I think the issue may lie in the compression stage. I will further test the speed with termux and compression ON.

Edit: Termux sftp with compression ON and sftp speed meter:

  • upload: 24.1MB/s
  • download: 9.2MB/s

Both case MUCH slower than without compression.

SodaWithoutSparkles avatar Jan 01 '23 10:01 SodaWithoutSparkles

Is there any update on this?

electr1fy0 avatar Jan 23 '23 08:01 electr1fy0

If I use TotalCommander on Android to compare the speed, I can switch between scp and sftp protocol. If I transfer via SCP I get usually 12MB/s, when I switch the same connection in TotalCommander to sftp, i have 4MB/s. Server in my case is a Raspberry pi 3b with internal-sftp from openssh. I don't know if a SFTP connection in Material Files can be primary a SCP connection with auto fallback to SFTP, if SCP is not available. As an alternative, there could be a checkbox to enable/disable SCP for a given connection.

On the other hand, I have tried Solid Explorer with a pure SFTP connection at 8MB/s for the same server/file combination.

There is a lot room for optimization in Material Files for a SFTP connection. Hopefully we get some update in the future.

If you need some tests, feel free to ask. I have no Android/Java coding skills, but I can test it with different server conditions if needed.

Offerel avatar Apr 30 '23 18:04 Offerel

Transfer speeds are very slow compared to termux sftp.

If not ssh, what other encrypted protocol is supported by Material Files that can offer higher file transfer throughput over network?

chaitan3 avatar Nov 19 '23 00:11 chaitan3