How does LiveKit handle autoscaling when self-host...
# ask-ai
a
How does LiveKit handle autoscaling when self-hosting in AWS?
t
Thanks for reaching out, Mark. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you understand how LiveKit supports autoscaling when self-hosting in AWS using Kubernetes Horizontal Pod Autoscalers (HPA), mainly configured through its Helm charts. Here’s a friendly overview of how it works: • LiveKit Server: Autoscaling is handled through the Helm chart's
autoscaling
configuration block. It leverages Kubernetes HPA based on CPU or memory usage. For instance, you can set a target CPU utilization of 60%, along with minimum and maximum replica counts to suit your needs. • Ingress and Egress Services: These services also support autoscaling! For Ingress, you can use a custom Prometheus metric
livekit_ingress_available
to scale based on how ready the service is, rather than just CPU or memory. This requires exposing metrics via the
prometheus_port
. • Graceful Scaling: When scaling down, pods enter a "draining mode," which means active rooms and sessions keep running smoothly while new connections are paused, helping to minimize any disruption. • Traffic Distribution: For AWS EKS setups, the Helm chart works with AWS ALB (Application Load Balancer) for TLS termination and routing traffic efficiently, supporting autoscaling by distributing traffic effectively. If you’d like, I’m here to walk you through any part of the setup or answer any questions you have about autoscaling! Sources: ingress-sample.yaml | Self-hosting the Ingress Service | LiveKit Docs | Deploy to Kubernetes | LiveKit Docs | Distributed Setup | LiveKit Docs | Self-hosting the Egress Service | LiveKit Docs
a
Does it only work with EKS?
t
Thanks for your question! I’m happy to share that LiveKit autoscaling isn’t limited to just EKS. It actually works smoothly on any supported Kubernetes platform, including Amazon EKS, Google GKE, and DigitalOcean DOKS. The autoscaling feature is powered by Kubernetes Horizontal Pod Autoscalers (HPA) and is set up through the Helm chart, which plays nicely with multiple cloud providers. As long as your Kubernetes cluster supports HPA and you have the necessary prerequisites in place—like Redis and the right network configuration—you should be good to go using LiveKit autoscaling on other platforms too. If you need any help with the setup, feel free to ask! Sources: Deploy to Kubernetes | LiveKit Docs | egress/templates/hpa.yaml
a
Does it need to be Kubernetes?
t
Hi there! I wanted to share that LiveKit autoscaling doesn’t actually require Kubernetes. While Kubernetes is definitely a supported and popular option for autoscaling with Horizontal Pod Autoscalers (HPA) through Helm charts, it’s not something you have to use. For instance, LiveKit can also be deployed and autoscaled on platforms like Render, which many find to be a simpler and more straightforward way to scale LiveKit workers. Plus, if you’re self-hosting on virtual machines (VMs), autoscaling is still totally doable by managing it through infrastructure-level scaling or other external orchestration tools. If you’d like, I’d be more than happy to walk you through some of the non-Kubernetes deployment options in more detail. Just let me know! Sources: Deployment and scaling | LiveKit Docs | examples/server-do.yaml | Deployment and scaling | LiveKit Docs | Running LiveKit on AWS
a
Yes please we're using AWS ECS
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!