Determining best TURN server

329 views
Skip to first unread message

Haseeb Abdul Qadir

unread,
May 17, 2015, 9:50:07 AM5/17/15
to discuss...@googlegroups.com
Hi,

I'm setting up multiple TURN servers across the globe. I want to make sure Webrtc picks the server which is closest / has best latency. If PeerConnection is configured to use multiple TURN servers will it automatically pick the one that has lowest latency? Or do I need to point it to the closest server myself?

Thank you.

Philipp Hancke

unread,
May 17, 2015, 8:27:44 PM5/17/15
to discuss...@googlegroups.com
On Sun, May 17, 2015 at 6:50 AM, Haseeb Abdul Qadir <has...@jumpdesktop.com> wrote:
Hi,

I'm setting up multiple TURN servers across the globe. I want to make sure Webrtc picks the server which is closest / has best latency. If PeerConnection is configured to use multiple TURN servers will it automatically pick the one that has lowest latency?

No. That's pretty easy to observe when adding two different TURN servers in http://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
-- you will get relay candidates from both servers (different host field).
 
Or do I need to point it to the closest server myself?

You might filter based on the foundation of the first relay candidate you get but that will keep alot of NAT bindings open.
So yeah, pointing your client to a TURN server in its region is the common approach here.

Nazmus Shakeeb

unread,
May 17, 2015, 10:48:00 PM5/17/15
to discuss...@googlegroups.com
>>If PeerConnection is configured to use multiple TURN servers will it automatically pick the one that has lowest latency?

Yes. TURN server having lowest latency will be selected during ICE check. (According to RFC and WebRTC specification. I myself have not tested this.)
 
Philipp Hanceke is also right,  PeerConnection will create allocation on multiple TURN servers but it will use closest one for relay.

Haseeb Abdul Qadir

unread,
Aug 17, 2015, 4:04:49 AM8/17/15
to discuss-webrtc
Just verified that it works exactly like this - thanks guys. As Philipp says it keeps the unused allocations open. Is there a way to force WEBRTC to drop unused TURN relay allocations? Keeping the allocations open prevents automatic client-side load balancing and failover for bigger deployments.
Reply all
Reply to author
Forward
0 new messages