Scaling the turnserver

696 views
Skip to first unread message

Andrew Benton

unread,
Feb 13, 2014, 12:07:16 AM2/13/14
to turn-server-project...@googlegroups.com
Hi everyone, just wondering how many of you are scaling your turn servers. It looks like I can add some multithreading options, but I was reading previously on this forum and that may not help me. I was hoping to run more turnserver processes to handle more load.

Or maybe I am missing something, and the turnserver runs on an event loop and I don't need a ton of processes per machine? should I just add more turnservers and load balance them?

Any help is appreciated.

Oleg Moskalenko

unread,
Feb 13, 2014, 2:15:53 AM2/13/14
to turn-server-project...@googlegroups.com

Yes, the turnserver runs in an event loop - one loop per thread. For the best performance it uses a thread per CPU core.

If you install a recommended platform (CentOS 6.5 or ArchLinux or Fedora 20) then everything will be adjusted automatically for you, you do not need to worry about the performance settings.

NEVER RUN MORE THAN ONE TURNSERVER PROCESS PER SYSTEM. It is possible but the tuning would require so deep understanding what is going on that I do not recommend it to anybody and we do not support that.

Scaling across multiple systems is possible, too.

Overall, all your questions are answered in details in the project performance wiki page. Just read it:

https://code.google.com/p/rfc5766-turn-server/wiki/turn_performance_and_load_balance

Regards,
Oleg

David P

unread,
Feb 18, 2019, 8:15:22 PM2/18/19
to TURN Server (Open-Source project)
Is there a standard CPU count and RAM level to handle hundreds to thousands of simultaneous relays? I realize that a precise answer depends on many factors described at https://github.com/coturn/coturn/wiki/TURN-Performance-and-Load-Balance but I'm looking for a standard practice as a starting point. For example, how about the two CPUs of a t2.micro ec2 in the free tier?

Zebadiah Long

unread,
Feb 18, 2019, 9:35:20 PM2/18/19
to David P, TURN Server (Open-Source project)
I just happen to have recently run some tests in that exact environment. It was not any sort of coordinated benchmarking though, just some random spot tests, but here are the results in case it helps you out.
For some background the messages being sent over the relay here are via Unity, so there's probably some hidden overhead in the message sizes. I wouldn't take any of this as gospel, but any info is better than no info. Hopefully most of the columns are self-explanatory. The extrapolated bandwidth column is something like how much bandwidth could be processed at 100% cpu utilization. Not sure if it has any actual meaning or if I was just pushing numbers around.

at rest 0at rest 1.9-2
ccu# of Clients# of Game InstancesString size sentSend RateBandwidth Rate (MB)Resulting CPU%Resulting MemoryExtrapolated bandwidth
1608201200.027465820316.51.90.4225510817
16082010200.27465820316.51.94.225510817
16082010100.13732910165.322.591115124
1608201050.068664550783.721.85579867
16082010300.41198730478.52highly variable cpu usage, drops to 7.3, goes up to 9.3 and all in between4.846909467
16082030200.82397460947.52slightly less variable cpu usage ~+-.5%10.98632813
8042010200.076293945313.722.061998522
12043010200.1144409185.722.007735403
4022010200.022888183592.320.9951384171
6023010200.034332275393.321.040371982
16082013301018.264770513.32.2553.4778942
160820600108.23974609442.2205.9936523

On Mon, Feb 18, 2019 at 8:15 PM David P <davidsw...@gmail.com> wrote:
Is there a standard CPU count and RAM level to handle hundreds to thousands of simultaneous relays? I realize that a precise answer depends on many factors described at https://github.com/coturn/coturn/wiki/TURN-Performance-and-Load-Balance but I'm looking for a standard practice as a starting point. For example, how about the two CPUs of a t2.micro ec2 in the free tier?

--
You received this message because you are subscribed to the Google Groups "TURN Server (Open-Source project)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turn-server-project-rfc57...@googlegroups.com.
To post to this group, send email to turn-server-project...@googlegroups.com.
Visit this group at https://groups.google.com/group/turn-server-project-rfc5766-turn-server.
For more options, visit https://groups.google.com/d/optout.

David P

unread,
Feb 18, 2019, 10:05:56 PM2/18/19
to Zebadiah Long, TURN Server (Open-Source project)
When you say you used the same environment, do you mean a 2-cpu t2.micro aws ec2?

It appears that the extrapolated MBps hovered around 2.0 across your test scenarios, or 16.0 Mbps.

Zebadiah Long

unread,
Feb 18, 2019, 11:52:42 PM2/18/19
to David P, Zebadiah Long, TURN Server (Open-Source project)
I just double checked and it's a t2.micro with 1 cpu.
Reply all
Reply to author
Forward
0 new messages