How can I use load testing?
# ask-ai
f
How can I use load testing?
t
Thanks for reaching out, Baymurat. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can use the LiveKit CLI to perform load testing on your LiveKit deployment. The CLI includes a
lk load-test
subcommand that simulates publishers and subscribers in a room, allowing you to test real-world scenarios with both video and audio tracks. Installation: • Mac:
brew install livekit-cli
• Linux:
curl -sSL <https://get.livekit.io/cli> | bash
• Windows:
winget install LiveKit.LiveKitCLI
Before running load tests, configure your system:
Copy code
ulimit -n 65535
sysctl -w fs.file-max=2097152
sysctl -w net.core.somaxconn=65535
sysctl -w net.core.rmem_max=25165824
sysctl -w net.core.wmem_max=25165824
Example load test commands: • Video publishers:
lk load-test --room test-room --video-publishers 8
• Audio publishers:
lk load-test --room test-room --audio-publishers 5
• Combined:
lk load-test --duration 1m --video-publishers 5 --subscribers 500
Best practices: • Run the load tester on a cloud VM to avoid local bandwidth constraints. • Use multiple machines for large-scale tests. • Monitor the test by joining the room with a generated token. • For LiveKit Cloud, load testing is limited to 50 publishers/subscribers due to policy restrictions. The CLI supports advanced options for customizing your test scenario, such as video resolution, simulcast, layout, and speaker simulation. It also provides detailed reporting on track statistics, bitrate, packet loss, and latency. For agent load testing and egress template testing, additional CLI subcommands are available. Let me know if you need specific examples or guidance for your use case. Sources: Custom Recording Template | LiveKit Docs | Benchmarking | LiveKit Docs | autocomplete/fish_autocomplete