Scaling TURN server

Hi,

I was wondering how to scale the turn server. I can create a turn server by installing
coturn on a seperate server and configuring it in prosody by enabling turncredentials module and configuring turncredentials_host , turncredentials_secret and turncredentials

This works. However TURN can use a lot of bandwidth. Can I just add more turn servers when needed? Is this question maybe better suited to be asked at coturn end, or can jitsi be configured to dynamically add and remove coturn servers like we can jvb.

Or is my thinking completely wrong

Hi,
I’d also be interested in this.
@PaAn: Did you find an answer on that question?

Sorry no. Haven’t found an answer to this yet.
Hopefully I’ll have time to do some tests/figure it out in the future, but I really don’t know what I’m doing.

Hi guys,

i’m currently trying to set up an infrastructure with several turn servers myself. My proof-of-concept seems to work so give it a try. There’re three places you have to modify (assuming a Debian install):

/etc/jitsi/meet/my-jitsi-domain-config.js

[...]
p2p: {
        
        useStunTurn: true,

        // The STUN servers that will be used in the peer to peer connections
        stunServers: [
            { urls: 'stun:my.turn1.net:443' },
            { urls: 'stun:my.turn2.net:443' }
        ],
[...]

/etc/jitsi/videobridge/sip-communicator.properties

[...]
org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES=my.turn1.net:443,my.turn2.net:443
[...]

/etc/prosody/conf.avail/my-jitsi-domain.cfg.lua

[...]
turncredentials_secret = "my-turnserver-static-secret"

turncredentials = {
  { type = "stun", host = "my.turn1.net", port = "80" },
  { type = "turn", host = "my.turn1.net", port = "80", transport = "udp" },
  { type = "turns", host = "my.turn1.net", port = "443", transport = "tcp" },
  { type = "stun", host = "my.turn2.net", port = "80" },
  { type = "turn", host = "my.turn2.net", port = "80", transport = "udp" },
  { type = "turns", host = "my.turn2.net", port = "443", transport = "tcp" }
};
[...]

Please note:

  • This example configures Jitsi resp. prosody to use two turn servers my.turn1.net, my.turn2.net .
  • All turn servers share the same static secret as configured for prosody.
  • As you can see i configured coturn to use ports 80 and 443. Of course your setup may differ.
1 Like