I would like to use a load balancer for livekit-se...
# ask-ai
l
I would like to use a load balancer for livekit-server media
t
Thanks for reaching out, Hugo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! To help you set up a load balancer for LiveKit media services smoothly, here are some friendly guidelines to follow: • WebRTC Media (UDP/TCP): It’s best to use a Layer 4 load balancer like AWS NLB or GCP TCP/UDP Load Balancer to forward UDP and TCP traffic straight to your LiveKit nodes. Just make sure the UDP port range (default: 50000–60000) is open and isn’t behind a TLS-terminating load balancer. • TURN Server: For TURN/TLS traffic, a Layer 4 load balancer will help route TCP traffic to your TURN service. And for TURN/UDP, don’t forget to open the necessary UDP port (such as 443) on your firewall and use host networking. • Helm Chart Deployment: If you’re deploying with Helm, you can enable TURN and set up the load balancer right in the Helm chart. For example, setting
turn.enabled=true
and
turn.tls_port=3478
will create a LoadBalancer service for TURN. • Global Scaling: To make sure users connect to the closest LiveKit node, use region-aware DNS and load balancing. Also, configuring Redis will help with distributed coordination. If you’d like more detailed steps or need to dive deeper, feel free to check out the Domain, SSL, and Load Balancer Setup and the Distributed Setup Guide. I’m here if you have any questions along the way! Sources: Deploying LiveKit | LiveKit Docs | examples/server-gke.yaml | Distributed Setup | LiveKit Docs