-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unused TURN allocations #1487
Comments
Hello @quadriq,
you could try this way and give me feedback, like I said above, I haven't tested it carefully. |
Hi @dangngoctam00 thank you, I will try it out. Does it actually means that "inactive allocation" would always have peer usage (peer_received_packets and, ss->peer_sent_packets) equal zero ? |
Hi @quadriq, this is what I've observed but I think you can test it yourself when having host-host candidate, it may take a long time to wait total of |
hello @quadriq , do you have any update on this requirement? |
Hi @dangngoctam00 , |
Sounds like this approach makes sense - count the connections that have more than 0 bytes sent/received If you want to completely avoid using TURN when not required you would need to do it in your application. It would be something like:
Overall, unused connections do not have much cost and auto-close in 10 minutes by default. |
Hi, so I finaly was able to run tests. What I did is introduced a marker in a session and then set it to 1, as soon as packet size hit 4095. So like:
After running tests I saw that the session with relay_marker == 1 was the one with the most traffic consumption for Relay-Connections. If the connection type was "host" then the marker stayed by 0. So this way worked for me to determinate if the session was active or not. Do not know if it's a good idea to add such variable to coturn for everybody, but for specific usecases and those who compiles coturn anyway, that looks like a solution of my problem. Thank you. |
@quadriq |
here is more code in case someone would like to reproduce:
|
Hi,
I noticed, that if I have TURN Server in ICE credentials. like:
The TURN server usually creates 4 allocations(2UDP + 2 TCP), even if the TURN connection is not needed, because WebRTC clients are in the same network and can communicate via the 'host' candidate. I believe this occurs during the process of gathering all available candidates. These are TURN session allocations, not STUN, as I am certain because I run STUN and TURN servers on different machines.
Now my question is, is there an indicator to filter out those 'unused' sessions on the TURN server? Maybe there is a place in the source code where I can look?
I would like to count the real usage of the TURN server by clients. My first thought was to simply check active TURN allocations, but because the allocation is always there, even the turn server was not really used, I am unsure how to achieve this.
Thank you for any ideas.
The text was updated successfully, but these errors were encountered: