question about multiple coturn servers in selfhosted #501

Open
opened 2025-11-20 05:12:36 -05:00 by saavagebueno · 3 comments
Owner

Originally created by @Fantu on GitHub (Nov 3, 2023).

Hi, now is possible set multiple coturn server, FWIK for example:

    "TURNConfig": {
        "TimeBasedCredentials": false,
        "CredentialsTTL": "12h0m0s",
        "Secret": "secret",
        "Turns": [
            {
                "Proto": "udp",
                "URI": "turn:server1.example:3478",
                "Username": "self",
                "Password": "password"
            },
            {
                "Proto": "udp",
                "URI": "turn:server2.example:3478",
                "Username": "self",
                "Password": "password"
            }
        ]
    },

How are these used?
Is each request sent to a random coturn server on the list or does it follow the order and use the subsequent ones if the first one is not reachable?

Originally created by @Fantu on GitHub (Nov 3, 2023). Hi, now is possible set multiple coturn server, FWIK for example: ``` "TURNConfig": { "TimeBasedCredentials": false, "CredentialsTTL": "12h0m0s", "Secret": "secret", "Turns": [ { "Proto": "udp", "URI": "turn:server1.example:3478", "Username": "self", "Password": "password" }, { "Proto": "udp", "URI": "turn:server2.example:3478", "Username": "self", "Password": "password" } ] }, ``` How are these used? Is each request sent to a random coturn server on the list or does it follow the order and use the subsequent ones if the first one is not reachable?
saavagebueno added the documentationmissing-docs labels 2025-11-20 05:12:36 -05:00
Author
Owner

@bcmmbaga commented on GitHub (Nov 3, 2023):

Hi @Fantu, They are all used at the same time. It always connects to all the URLs there and checks them for connectivity. If one is able to connect, it will use it.

@bcmmbaga commented on GitHub (Nov 3, 2023): Hi @Fantu, They are all used at the same time. It always connects to all the URLs there and checks them for connectivity. If one is able to connect, it will use it.
Author
Owner

@mlsmaycon commented on GitHub (Nov 3, 2023):

the agent will connect to all TURN servers, and them it will use these connections to check if it can communicate with the other peers. If one responds faster, it will use it instead of the other, but there is no way to order these checks besides how you configure them.

Once a turn is selected and used for the connection, the agents periodically send checks to validate if they are still available; if something goes wrong with the checks, the negotiation is restarted. There is no use of the next relay server in this case (not yet)

In that sense, ICE chooses the faster one to reply to the initial check. Which, in many cases, is the one with a lower latency

@mlsmaycon commented on GitHub (Nov 3, 2023): the agent will connect to all TURN servers, and them it will use these connections to check if it can communicate with the other peers. If one responds faster, it will use it instead of the other, but there is no way to order these checks besides how you configure them. Once a turn is selected and used for the connection, the agents periodically send checks to validate if they are still available; if something goes wrong with the checks, the negotiation is restarted. There is no use of the next relay server in this case (not yet) In that sense, ICE chooses the faster one to reply to the initial check. Which, in many cases, is the one with a lower latency
Author
Owner

@Fantu commented on GitHub (Nov 3, 2023):

thanks to all for the replies
the @mlsmaycon one is the more complete, I suggest should be used to improve the documentation as can be useful to know

@Fantu commented on GitHub (Nov 3, 2023): thanks to all for the replies the @mlsmaycon one is the more complete, I suggest should be used to improve the documentation as can be useful to know
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#501