Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC: peer connections limit?

Tags:

How many peer connections can I create on a single client? Is there any limit?

like image 474
kongaraju Avatar asked Apr 15 '13 12:04

kongaraju


People also ask

How many connections can WebRTC handle?

As many as you like. You can cram anywhere from one to a million users into a WebRTC call.

Is WebRTC only peer-to-peer?

WebRTC is designed to work peer-to-peer, so users can connect by the most direct route possible. However, WebRTC is built to cope with real-world networking: client applications need to traverse NAT gateways and firewalls, and peer to peer networking needs fallbacks in case direct connection fails.

What is WebRTC peer connection?

Peer connections is the part of the WebRTC specifications that deals with connecting two applications on different computers to communicate using a peer-to-peer protocol. The communication between peers can be video, audio or arbitrary binary data (for clients supporting the RTCDataChannel API).


2 Answers

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

like image 188
Yousef Amar Avatar answered Oct 05 '22 23:10

Yousef Amar


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.

like image 37
kongaraju Avatar answered Oct 06 '22 01:10

kongaraju