I’m trying to horizontally scale a LiveKit + SIP t...
# ask-ai
e
I’m trying to horizontally scale a LiveKit + SIP trunk setup on AWS when all traffic from the telco comes from a single fixed IP. Today I run one SIP gateway pod and one LiveKit server pod; they connect over WebSocket. In front I use an AWS Network Load Balancer (UDP) that points to an Auto Scaling Group. In the docs: AWS Network Load Balancer, when handling UDP, distributes packets using a flow hash (5-tuple: src IP, src port, dst IP, dst port, protocol). Packets from the same client will go to the same target as long as the src IP and src port stay the same. Because the telco uses one IP, the flow hashing keeps sending traffic to the same target. Even if I add more SIP/LiveKit pods, one pair ends up taking almost everything. A call that starts on one pod needs to stay on that pod. If I turn off stickiness, packets can be sent to another SIP gateway pod mid-call and that causes errors. What’s a practical way to make this scale horizontally? How can I add a second SIP+LiveKit pair and actually get traffic to it?
t
Thanks for reaching out, Daniil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks so much for reaching out! To help you smoothly scale your LiveKit + SIP trunk setup on AWS, could you please share a bit more detail? • Are you running LiveKit self-hosted on AWS EC2, or are you using LiveKit Cloud? • What kind of AWS load balancer do you have in place (like an Application Load Balancer or Network Load Balancer)? Also, are you thinking about any specific stickiness settings, such as source IP or cookie-based? • Is the fixed IP coming from your SIP provider (like Twilio or Telnyx)? And are you using a regional or global LiveKit SIP endpoint? Once I have this info, I’ll be able to guide you more precisely. Looking forward to helping you get this all set up perfectly! Sources: SIP overview | LiveKit Docs | SIP inbound trunk | LiveKit Docs | SIP outbound trunk | LiveKit Docs
e
1. I am running self hosted Livekit in AWS ec2 2. Network Load Balancer, I am using source IP stickiness 3. Livekit SIP is also self hosted and SIP provider use one fixed IP
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!