Unequal load balancing of turn servers by webRTC

205 views
Skip to first unread message

VIVAN GURU

unread,
Aug 19, 2019, 9:16:37 AM8/19/19
to TURN Server (Open-Source project)
I am currently using two coturn servers for my video calling application. As far as I know the load balancing is handeled by webRTC based on the latency time during connectivity checking phase of candidates. In my application most of the call media is relayed using Server A while other turn server is being under utilised. Server A is relaying 14 to 15 MBps of data while at the same time Server B is relaying 100-120 KBps of data. 

My query is that how can I balance the call data tranfer more equally?? Also how exactly does webrtc choose one server over another?? How can I check at real time the parameters based on which choosing of turn server is done?? Also it will be a real help if someone can point the probable issues that may lead to this case. 

Both Server A and B are present at different geographical locations and irrespective of proximity to the server the call data is always relayed using Server A.

Warren McDonald

unread,
Aug 21, 2019, 9:34:21 AM8/21/19
to TURN Server (Open-Source project)
Hi Vivan,

in my experience the latency difference has to be significant for this to be a decider for the ICE Candidate selection. With 2 servers 4000KM apart, and a user near either server, the first server listed in the ICE config will always be used.

Depending on the geographical spread, you could use Region based DNS, or Latency based DNS as more accurate way of returning the address of the closest TURN server. AWS have these options in their Route53 DNS service. If the servers are in the same region then latency based option may be better, as it can be tuned a bit, to add bias to to a location. 

On the fair allocation of resources, round robin DNS is fine, if you just want to share load across available servers. Adding a DNS health check is a good idea to make sure that if a server is down, it won't be included in the DNS answers. We run a combination of the these approaches with two TURN servers in each location. 


Warren
Reply all
Reply to author
Forward
0 new messages