Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot Webrtc is too slow #84645

Open
tlloancy opened this issue Nov 9, 2023 · 9 comments
Open

Godot Webrtc is too slow #84645

tlloancy opened this issue Nov 9, 2023 · 9 comments

Comments

@tlloancy
Copy link

tlloancy commented Nov 9, 2023

Godot version

4.1.3

System information

Any

Issue description

I think my question couldn't be more accurate than :
https://stackoverflow.com/questions/56327783/webrtc-datachannel-for-high-bandwidth-application

TLDR with transfert fonctions already using the max packet size allowed of 256k, my transfert speed on both applications on same network barely reaches 6-7 MB wheres as on remote connection with bandwith equivalent to 20MB , the data transfert will drop somewhere between 300-600 KB ps when it's not almost zero using mobile data with bandwith of 1MB.

As when connected we dont know if we're on turn or real p2p, i tried usine another turn server and the result is the same. Is there optimizations or a way of troubleshootings that i am missing ?

Steps to reproduce

Remotely connect webrtc peer, send packets.

[Edit] my point is, for exemple, why is a ssh copy ten times faster ?

Minimal reproduction project

N/A

@fire fire changed the title godot webrtc too slow Godot Webrtc is too slow Nov 9, 2023
@Calinou
Copy link
Member

Calinou commented Nov 10, 2023

Which platform did you do your testing on? WebRTC can be used both natively and in a web browser. This is an important nuance because the implementation is entirely different.

Please test both native-to-native and native-to-web scenarios to make sure this isn't specific to a single platform.

Also, please upload a minimal reproduction project1 to make this easier to troubleshoot.

[Edit] my point is, for exemple, why is a ssh copy ten times faster ?

WebRTC is designed for real-time communication (it's in the name), while SSH is a TCP-based protocol. TCP can do high throughput very well, but struggles at low-latency communication. By contrast, WebRTC is designed for low-latency communication but struggles with delivering high throughput.

If you want to prioritize throughput over latency, use WebSocket or (ideally) HTTP requests. You can keep using both protocols at the same time: WebRTC for real-time needs, HTTP requests to download/upload large files.

As when connected we dont know if we're on turn or real p2p, i tried usine another turn server and the result is the same. Is there optimizations or a way of troubleshootings that i am missing ?

Test on a local network with both machines connected over Ethernet to remove any external conditions.

Footnotes

  1. A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the .godot folder in the archive (but keep project.godot).

    Drag and drop a ZIP archive to upload it. Do not select another field until the project is done uploading.

    Note for C# users: If your issue is not Mono-specific, please upload a minimal reproduction project written in GDScript or VisualScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a Mono setup available.

@tlloancy
Copy link
Author

If by native you mean from app to app yes I don't use any web browser, it's nice If I can keep webrtc and use other protocol but I would like to keep it P2P.

What is the maximum file size I can push

@Calinou
Copy link
Member

Calinou commented Nov 10, 2023

What is the maximum file size I can push

The maximum size for GitHub attachments is 25 MB (remember to remove the .godot/ folder within the ZIP to make it smaller). If you need to upload something larger, create a public GitHub repository and link it here.

@tlloancy
Copy link
Author

godot-test-webrtc.zip

@tlloancy
Copy link
Author

tlloancy commented Mar 9, 2024

Hi folks ! any news ?

@tlloancy
Copy link
Author

I'd like to be able to catch webrtc errors in godot , like when ice url is invalid etc ...

@Calinou
Copy link
Member

Calinou commented Mar 29, 2024

I'd like to be able to catch webrtc errors in godot , like when ice url is invalid etc ...

Please open a proposal for this, as this isn't strictly related to this issue.

@tlloancy
Copy link
Author

just put my proposal here godotengine/webrtc-native#145 as i think it might be a good place to start w/

@tlloancy
Copy link
Author

(Because it can be both USer and DEv useful usage after all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants