localsend / localsend

An open-source cross-platform alternative to AirDrop
https://localsend.org
Apache License 2.0
47.38k stars 2.49k forks source link

Accelerate large file transfer speed #384

Open daifiyum opened 1 year ago

daifiyum commented 1 year ago

Is your feature request related to a problem? Please describe.

When transferring large files, such as files of a few gigabytes, the transfer speed is not fast enough, usually around 20MB/s. Even if the phone has 5G wifi enabled and the computer supports 5G wifi, this is still the case.

Describe the solution you'd like

I have conducted experiments and found that under 5G WiFi, computers and mobile phones can reach around 50MB/s through FTP transmission, sometimes even exceeding 100MB/s. Can LocalSend software consider supporting FTP transmission?

Describe alternatives you've considered

No response

Additional context

No response

septs commented 1 year ago

https://github.com/localsend/protocol/pull/5/files

v2 protocol not include Range, Content-Range supports

see https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range

i think, you need create issue to https://github.com/localsend/protocol

Tienisto commented 1 year ago

@septs Your comment has nothing to do with the original issue. Please comment on the pull request.

Tienisto commented 1 year ago

After some debugging, I have noticed, that HTTP is much faster than HTTPS. In my test case, HTTP reached 50 MB/s while HTTPS only reached 7 MB/s.

I am not sure how to fix this as I only use the Flutter API (both with dio and with http package).

Edit: It seems that Android is the device causing slow transmission speeds. Windows <-> macOS reached 60 MB/s with HTTPS.

yozachar commented 1 year ago

I'm on a 5GHz WiFi sharing files from Linux to Windows, but the transfer rate is incredibly slow.

image

ref: https://en.wikipedia.org/wiki/IEEE_802.11ac-2013#Data_rates_and_speed

Weirdly SAMBA is also slow on the same network: image

Even more weirdly, it's faster in 2.4 GHz WiFi

image

Same network with WPA-3-AES encryption

Saqib92 commented 11 months ago

Same issue when doing Windows <--> Android or Windows <--> iOS or iOS <--> Android tried in both 5G or normal wifi. very sloww speed.

lasersPew commented 10 months ago

On my test case, I've sent a 4GiB file to 2 phones, Samsung A13 and A52 5G. The first run, one in 2.4G and another in 5G band(encryption closed in all of the tests), the 2.4G one had 2.5MB/s average with 3.0MB/s peak and the 5G one has 12 MB/s average with peak of 13MB/s. Same result when I switched the networks. My PC(source) btw is in 5G. When both in 5G band, either one maxes at 2-3MB/s and 6-8MB/s avg or they're stuck at 4MB/s. Well, they both fail before finishing the transfer tho.

lasersPew commented 10 months ago

Another Test case, Android to Android, A52 to A13, 1GiB test file, has the fastest speed(started at 10MB/s and ended at 40MB/s). Same thing on reverse. The thing is, when I quit the app, the sending stutters.

4GB test file: A13 to A52, 2.5G: 5.0-5.6MB/s A13 to Win11, A52 to A13, A13 to A52, A52 to Win11 2.5G to 5G: 5.0-6.0MB/s A52 to Win11, 5G: slowly rising to around 6.5-8.0MB/s A13 to Win11, A52 to A13 and A13 to A52e, 5G: 8.0-10.0MB/s

yozachar commented 10 months ago

v0.12.0 (38) ~ 5GHz Mobile Hotspot

  1. Screenshot from 2023-11-25 17-11-13 Android to Linux ~ 23 MB/s
  2. image Linux to Android ~ 12 MB/s
nmummau commented 9 months ago

I'm noticing slowness too that is surprising to me. I'm transferring a 4.4 GB file. Linux -> Android, with both devices on the same 5 GHz home wifi network, speeds observed are ~2.4 MB/s LocalSend v1.13.1 (42)

OS Image
Linux, Ubuntu 22.04.3 LTS
sending
Android, Version 14
receiving
MahouShoujoMivutilde commented 8 months ago

I've also noticed that transfers are kind of slow.

On LAN (1G) 3.9GB file from the windows notebook to the linux pc transfers at 21 MBytes/s.

For comparison, rsync over ssh inside WSL from the same machine is 91.5 MBytes/s (which is worse than I get from the other PCs, but the notebook is quite a bit weaker than them, so that's expected).

I don't expect https and ssh to be the same speed, because different protocols (duh), but the difference looks too big.

Tienisto commented 8 months ago

A quick update:

It seems that the slow speed is caused by the inefficient HTTPS implementation. Thanks to @tom8zds who has implemented a Rust backend which you can checkout at this repo: https://github.com/tom8zds/localsend_rs The disadvantage with Rust is that it will make the build system much more complex, and I am not sure if you can compile it to all targets that LocalSend currently supports.

To sum up, you need to disable encryption if you want full speed. This has to be addressed by the Dart team. There is nothing LocalSend can do.

Related #1076

Pentaphon commented 3 months ago

Will probably depend on https://github.com/localsend/localsend/issues/491 being implemented

miss5tability commented 1 month ago

After some debugging, I have noticed, that HTTP is much faster than HTTPS. In my test case, HTTP reached 50 MB/s while HTTPS only reached 7 MB/s.

I am not sure how to fix this as I only use the Flutter API (both with dio and with http package).

Edit: It seems that Android is the device causing slow transmission speeds. Windows <-> macOS reached 60 MB/s with HTTPS.

Can U tell me how to switch from https to http?:)

Tienisto commented 1 month ago

Can U tell me how to switch from https to http?:)

@miss5tability you need to go settings, enable "Advanced settings", disable "encryption". Edit: Make sure to disable encryption on all devices

miss5tability commented 1 month ago

i,m doing that but still maxed out 12-13 mb/s

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Nie zawiera wirusów.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

śr., 4 wrz 2024 o 11:17 Tien Do Nam @.***> napisał(a):

Can U tell me how to switch from https to http?:)

@miss5tability https://github.com/miss5tability you need to go settings, enable "Advanced settings", disable "encryption". Edit: Make sure to disable encryption on all devices

— Reply to this email directly, view it on GitHub https://github.com/localsend/localsend/issues/384#issuecomment-2328341575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV2TYNQCKOCMB3QN6QFXCLLZU3F2HAVCNFSM6AAAAAAXAOG3HGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRYGM2DCNJXGU . You are receiving this because you were mentioned.Message ID: @.***>

-- Shalom

CodePeacock commented 1 week ago

Good that I looked around in the issues section. FTP really works well for bidirectional transfers. Here's the gist

  1. Expose device as FTP server
  2. Let users on local network connect to said server, the same way it does currently.

NOTE: You can delete this comment without informing if it is stupid 🫡