Maximum number of RTCPeerConnection
Asked Answered
T

3

8

I know web browsers have a limit on the amount of simultanous http requests etc. But is there also a limit on the amount of open RTCPeerConnection's a web page can have?

And somewhat related: RTCPeerConnection allows to send multiple streams over 1 connection. What would be the trade-offs between combining multiple streams in 1 connection or setting up multiple connections (e.g. 1 for each stream)?

Tocci answered 17/12, 2016 at 1:29 Comment(0)
M
12

Not sure about the limit, but I think it is around 256 (last time I heard). I saw someone do 200 connections on a single web page recently (via http://testrtc.com).

Multiple RTCPeerConnection objects are great:

  • They are easy to add and remove, so offer a higher degree of flexibility when joining or leaving a group call
  • They can be connected to different destinations

That said, they have their own challenges and overheads:

  • Each RTCPeerConnection carries its own NAT configuration - so STUN and TURN bindings and traffic takes place in parallel across RTCPeerConnection objects even if they get connected to the same entity (an SFU for example). This overhead is one of local resources like memory and CPU as well as network traffic (not huge overhead, but it is there to deal with)

  • They clutter your webrtc-internals view on Chrome with multiple tabs (a matter of taste), and SSRC might have the same values between them, making them a bit harder to trace and debug (again, a matter of taste)

A single RTCPeerConnection object suffers from having to renegotiate it all whenever someone needs to be added to the list (or removed).

Manton answered 18/12, 2016 at 6:18 Comment(2)
Thanks, that's exactly the kind of info I was looking for.Tocci
Read also here - I've dug deeper into the topic - bloggeek.me/webrtc-rtcpeerconnection-one-per-streamManton
T
0

here is the chrome bug list.

But it's not fixed now.

Twofold answered 25/3, 2020 at 11:8 Comment(0)
T
0

Based on page 14 of webrtc for the curious ebook which says:

group:BUNDLE Bundling is an act of running multiple types of traffic over one connection. Some WebRTC implementations use a dedicated connection per media stream. Bundling should be preferred

so I was thinking using just one RTCPeerConnection to handle different types of streams is preferred. If you think this opinion is wrong, I will be happy to correct me.

Tenaculum answered 11/7, 2021 at 14:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.