What are recommended server specs for a coturn server? RAM and disk, cores if that matters. Thank you.
It depends on load.
You should experiment and measure it..
It is pretty well optimized..
@misi
It depends on load.
That's why a good answer to this question would be "X RAM per Y users" etc.
I meant network load.
Unfortunately I don't have measured numbers. So sorry.
CPU and Mem related to X parallel connection, and B bandwidth/per connection.
Try to use turnutils_uclient and turnserver to measure it.
Unfortunately I couldn't help you more..
As @misi mentions, you need to do some measurement to see how much cpu, memory, and bandwidth you would need per user.
If you are using WebRTC with coturn, you can do some rough estimation, though. Last time I checked, a simple WebRTC connection uses an upper limit of 2mbps for video and around 40kbps for audio. For simplicity's sake, let's just say you would need 2mbps in and out for each peer. If you have a 200mbps full duplex connection, you can handle roughly 50 peers concurrently. It is possible to restrict the bandwidth when using TURN (we did this when I worked at appear.in). If you limit it to 0.5mbps, now you can handle 200 peers concurrently with the same bandwidth.
CPU and memory estimates are harder to do. Peers using TCP instead of UDP will use more kernel memory (for the socket state), and peers using (D)TLS will use more CPU than those not. This is where it's important to measure and monitor. In my experience at appear.in, a 2 CPU machine wtih 4GB of RAM and a 250mbit connection worked well with a mix of UDP, TCP, and TLS clients. The network would always get saturated before the CPU or memory usage became a problem.
Coturn does not use any disk space per user, but it does write logs to disk, so it's always possible to fill up the disk with logs if left running long enough. Personally, I recommend using syslog, since it typically has the ability/option to do log rotation and expiration.
Most helpful comment
As @misi mentions, you need to do some measurement to see how much cpu, memory, and bandwidth you would need per user.
If you are using WebRTC with coturn, you can do some rough estimation, though. Last time I checked, a simple WebRTC connection uses an upper limit of 2mbps for video and around 40kbps for audio. For simplicity's sake, let's just say you would need 2mbps in and out for each peer. If you have a 200mbps full duplex connection, you can handle roughly 50 peers concurrently. It is possible to restrict the bandwidth when using TURN (we did this when I worked at appear.in). If you limit it to 0.5mbps, now you can handle 200 peers concurrently with the same bandwidth.
CPU and memory estimates are harder to do. Peers using TCP instead of UDP will use more kernel memory (for the socket state), and peers using (D)TLS will use more CPU than those not. This is where it's important to measure and monitor. In my experience at appear.in, a 2 CPU machine wtih 4GB of RAM and a 250mbit connection worked well with a mix of UDP, TCP, and TLS clients. The network would always get saturated before the CPU or memory usage became a problem.
Coturn does not use any disk space per user, but it does write logs to disk, so it's always possible to fill up the disk with logs if left running long enough. Personally, I recommend using syslog, since it typically has the ability/option to do log rotation and expiration.