schlagmichdoch / PairDrop

PairDrop: Transfer Files Cross-Platform. No Setup, No Signup.
https://pairdrop.net
GNU General Public License v3.0
4.3k stars 245 forks source link

Bug: transfers are incredibly slow #44

Open nealhead opened 1 year ago

nealhead commented 1 year ago

Attempting to transfer a file between clients is unimaginably slow

Steps to reproduce the behavior:

  1. Go to pairdrop.net
  2. Click on link in top right
  3. Pair with device
  4. Transfer file

Expected behavior I expect the speed of the connection between the two devices

Desktop (please complete the following information):

Self-Hosted Both self-hosted and Pairdrop official site

Self-Hosted Setup Proxy: Nginx Deployment: Unraid

Additional context Add any other context about the problem here.

nealhead commented 1 year ago

I tested on two different browsers on the same PC and still experienced the slow speeds

schlagmichdoch commented 1 year ago

Is this still the case for you? Have you done some additional testing? Have you tried hosting your own instance?

chadoe commented 1 year ago

Same for me. Tried to send a 200MB video but it was indeed incredibly slow. Devices are on the same network. Any way I can tell if it's using a direct connection or if it's trying to use the public turn server?

schlagmichdoch commented 1 year ago

I have since added a new TURN server for pairdrop.net that should increase the transfer speed. Could you try again @chadoe @nealhead ?

cxzlw commented 1 year ago

I have since added a new TURN server for pairdrop.net that should increase the transfer speed. Could you try again @chadoe @nealhead ?

Sorry but the speed is still very slow (about 2M/s even 500k/s) although I am using my mobile's hotspot (wifi6 5ghz).

schlagmichdoch commented 1 year ago

Thanks for reporting! The slow speed is browser specific as the bottleneck is the webrtc implementation. I will play around with the code to try to increase the webrtc bandwidth and keep you updated.

jeremyjohn commented 11 months ago

Same here, pairdrop.net and self-hosted docker transfer from mobile to desktop and other devices getting capped at 300-400KB/s.

I tested on another app called sharedrop.io and got full speed of the device connection. I looked around at their code seems like something to do with the webrtc chunks setting https://github.com/szimek/sharedrop/blob/master/app/services/web-rtc.js

I prefer pairdrop ui/ux over others, hope the speed issue can be resolved.

cxzlw commented 11 months ago

Same here, pairdrop.net and self-hosted docker transfer from mobile to desktop and other devices getting capped at 300-400KB/s.

I tested on another app called sharedrop.io and got full speed of the device connection. I looked around at their code seems like something to do with the webrtc chunks setting https://github.com/szimek/sharedrop/blob/master/app/services/web-rtc.js

I prefer pairdrop ui/ux over others, hope the speed issue can be resolved.

Yeah, and I am using LocalSend. You may want to have a try because of its ui.

:)

cxzlw commented 11 months ago

Same here, pairdrop.net and self-hosted docker transfer from mobile to desktop and other devices getting capped at 300-400KB/s.

I tested on another app called sharedrop.io and got full speed of the device connection. I looked around at their code seems like something to do with the webrtc chunks setting https://github.com/szimek/sharedrop/blob/master/app/services/web-rtc.js

I prefer pairdrop ui/ux over others, hope the speed issue can be resolved.

Yeah, and I am using LocalSend. You may want to have a try because of its ui.

:)

And high speed

schlagmichdoch commented 4 months ago

The following comments were deleted by GitHub (via hubot) as part of mistakenly marking this account as spam on 17th February 2024. The correct thread order and the creation date is unclear. I decided to manually restore them anyway in order to complete the information this issue holds even though the restored information might be outdated:

Comment by @schlagmichdoch:

Does this only happen on paired devices? Devices that are behind a NAT need a TURN server to establish the peer-to-peer connection. Apparantly the public turn server is quite slow.

Try this to bypass the need for a TURN server: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/faq.md#transferring-many-files-with-paired-devices-takes-too-long

If you self-host you can also run your own stun and turn server which should increase the speed a lot if done right. See this issue for more info: #32

jmaximusix commented 3 months ago

I have the same issue, regardless of using my selfhosted instance or the official pairdrop.net site. My wifi should be able to push Gigabit speed, yet a simple file transfer of 260MB took about 10 minutes, which is just painfully slow

ksweidmann commented 3 months ago

Hello. I'm tested it on local own server with devices connected via local network and i can says it have extremely slow transfer.

schlagmichdoch commented 1 month ago

I have rewritten the file chunker and digester code which was written for Snapdrop and had indeed some flaws.

With these changes I could transfer a 1.5GB file from Ubuntu Firefox to iOS Safari on the same network with speeds up to 15 MB/s.

An instance is ready for testing if anyone wants to give it a try: https://pairdrop-dev.onrender.com/

Known issue: When receiving a file on mobile, the filename is incorrect when using the share menu.

trmdi commented 1 month ago

With these changes I could transfer a 1.5GB file from Ubuntu Firefox to iOS Safari on the same network with speeds up to 15 MB/s.

Here Pairdrop gets < 3MB/s while Localshare gets ~10MB/s.

schlagmichdoch commented 1 month ago

As long as we don't have native clients (see #292) we are bound by the abilities of browsers as their WebRTC implementation is the current bottleneck for transfer speeds. On the contrary, LocalSend only ships native applications and benefits by having higher transfer speeds.

To compare PairDrop to LocalSend is only to some extent useful as both have their respective strengths. For PairDrop that's definitely "No setup. No signup.". It runs in the browser without the need to install anything which makes it usable on almost every device. Additionally, there is its universality, as you can use it in many scenarios and most network configurations (same network, different networks, mobile data etc.). You do not need to be on the same network and it still works the same.

For PairDrop it depends on the browsers and devices that are used. As browsers are restricted by the OS, enabling/disabling the Power Saver Mode might also make a difference for transfer speeds.

After this release I guess I will start to implement #292 to increase the transfer speed further for users who are willing to install an app. With this we would probably get to much higher speeds.

I would appreciate if someone else could test if everything still works as expected.

trmdi commented 1 month ago

I mean is there anything else that could be improved e.g. multi-thread transferring?

flashlab commented 1 month ago

Slower than https://www.ppzhilian.com/ and https://fastsend.ing/

An instance is ready for testing if anyone wants to give it a try: https://pairdrop-dev.onrender.com/

Amazing! Much faster than current one, but not quite stable, seems the speed slow down in the middle of tranfer process, while speed up in the tail.