Need to load test the livekit self hosted
# ask-ai
s
Need to load test the livekit self hosted
t
Thanks for reaching out, Nouman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To load test your LiveKit self-hosted server, you can use the built-in load testing functionality provided by the LiveKit CLI. Below are the steps and commands to help you get started: 1. Installation and Setup • Install the LiveKit CLI if you haven’t already. The CLI includes the
lk load-test
subcommand, which simulates real-world loading conditions for various scenarios. 2. Basic Load Testing Commands Audio-Only Load Testing: Sources: Benchmarking | LiveKit Docs
s
i want the command where we have 1 room for audio and video and have 250 subscribers
t
Hey there! 👋 Want to run a quick load test with audio, video, and a bunch of subscribers? I've got just the command for you. Check this out:
Copy code
lk load-test \
--url <your-server-url> \
--api-key <your-key> \
--api-secret <your-secret> \
--room load-test \
--video-publishers 1 \
--audio-publishers 1 \
--subscribers 250
This setup creates a single room with one audio and one video publisher, plus 250 subscribers. Feel free to tweak the numbers to match exactly what you're looking to test. Need any help customizing it? Just ask! 😊
s
should we incerase the number of rooms?
t
Hey there! Let's talk about scaling up your LiveKit room testing. 🌟 Think of it like planning a party - sometimes you want one big gathering, and other times you might prefer smaller, more intimate group hangouts. Here's how you can set up your load testing to match exactly what you need: • Single Room: If you're looking to simulate one big virtual meetup with lots of people, just stick to testing a single room. Perfect for those large team or conference-style scenarios! • Multiple Rooms: Want to mimic more realistic collaboration spaces? No problem! You can spread out your participants across multiple rooms - kind of like creating different breakout spaces or session zones. The cool part is how easy it is to do this. Just use the --num-rooms parameter, and you're all set. Check out this example that creates 5 rooms with 50 participants in each:
Copy code
lk load-test \
--url <your-server-url> \
--api-key <your-key> \
--api-secret <your-secret> \
--room load-test \
--video-publishers 1 \
--audio-publishers 1 \
--subscribers 50 \
--num-rooms 5
Feel free to play around with the numbers to match exactly what you're looking to test. You've got this! 💪
s
i have livekit deployed on k8s
t
Hey there! Running load tests on LiveKit in a Kubernetes environment? No worries, I've got some friendly tips to help you out. • Cluster Resources: Just like making sure you've got enough snacks for a movie marathon, check that your K8s cluster has plenty of CPU, memory, and network bandwidth. Keep an eye on those resources during your test – it'll help you spot any potential hiccups. • Horizontal Pod Autoscaling: Think of this like having a magical helper that brings in extra hands when things get busy. If you've set up autoscaling, your cluster should automatically scale up. Just double-check those settings to make sure everything's working smoothly. • Service Load Balancer: This is like having a friendly traffic director making sure your LiveKit pods aren't overwhelmed. Verify that your Kubernetes service is set up to spread the load evenly. • File Handles: Give your LiveKit pods some breathing room by configuring the
ulimit
settings. It's like making sure they have enough elbow room to work comfortably. You can run these load testing commands from outside the cluster or from within – whatever works best for you. If you're testing from inside the cluster, just make sure the CLI can reach the LiveKit API and has the right credentials. Need any more help navigating this? I'm here for you! Feel free to ask if anything's unclear.
s
Incorrect Usage: flag provided but not defined: -num-rooms
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!