How many peer connections can I create on a single client? Is there any limit?
Not sure if there is any hard limit(other than runtime memory), but there is certainly soft one.
If you are considering fully mesh topology(app in which every client is connected to every other client), then you have to consider main deficiency of this topology. For large number of participants in video conference session bandwidth which is required to sustain the overall session grows for each new participant.
Therefore, users with low bandwidth will not be able to handle video conference session with big number of participants.
Hope it helps.
Maximum peer connections limit is 256 (on chrome).
Not sure about other major browsers, depending on your bandwidth they are limited to give certain stability.
I assume you've arrived at 256 experimentally since there is currently no documentation/specs to suggest it. I don't know exactly how things have changed since 2013, but currently, my own experiments cap out at 500 simultaneous connections per page. As far as I can tell, Firefox has no such limit.
The real limit, according to Chromium source code is 500 (source). As far as I can tell, there was no limit before this was implemented (source) even going as far back as the WebKit days.
I think one reason that it can be tricky to keep track of is that Chrome (and FF for that matter) have always been bad at the garbage collection of dead connections. If you check chrome://webrtc-internals
(FF equivalent: about:webrtc
), there will often be a build-up of zombie connections that count towards the 500 limit. These persist until you manually destroy them, or close/refresh the page. One way to work around this is through your own heartbeat implementation or using the signalling server to notify of peers disconnecting such that other peers can destroy their connection (although this requires a persistent connection to a signalling server).
This is an interesting topic.. I was just watching this youtube video about Multi Peer in WebRTC. The presenters said it just depend on the number of peers, but the highest he did was on less than 6 peers. Also this depends on your bandwidth size. The best thing you can do is to develop an WebRTC and try connecting with your friends and judge as this also depends on the country you are in. Like I live in Botswana and the network is not fast so i wont expect to be having 6 peers while I am still suffering to get a clear communication with only one person this side.
According to this source:
In practice, even under optimal network conditions, a mesh video call doesn’t work well beyond five participants.