Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum number of RTCPeerConnection

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)?

like image 756
Seba Kerckhof Avatar asked Dec 17 '16 01:12

Seba Kerckhof


1 Answers

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).

like image 72
Tsahi Levent-Levi Avatar answered Sep 22 '22 13:09

Tsahi Levent-Levi