Hi! I need to build a multitenant environment beca...
# ask-ai
c
Hi! I need to build a multitenant environment because we will use livekit in our SaaS application. What are the best pracetices in definition of livekit? 1 Agent per customer? 1 agent per Voicebot per customer? only 1 agent and dinamically set the configuration of each tenant? We have 150 customers using voicebots
t
Thanks for reaching out, Mauricio. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you build a multitenant environment for your SaaS application using LiveKit, here are some friendly best practices to consider: • Distributed Mesh Architecture: Leveraging LiveKit's distributed mesh architecture can really boost scalability and smoothly handle lots of participants at once. • Multi-Home Architecture: Setting up multiple points of presence (PoPs) around the world helps keep latency low, so your users get a great experience no matter where they are. • Tenant Isolation: It’s important to keep tenants well isolated by using separate networks and adding rate limits and access controls to keep things secure and running smoothly. • Agent Worker Deployment: Since workers are stateless and easy to scale horizontally, using separate LiveKit projects and credentials for development and production can really help keep things organized. • Redis for Clustering: Configuring Redis for distributed operation allows for smart routing and better performance, which can make a big difference. • Failover and Draining: Adding connection draining and failover mechanisms ensures your system stays reliable and available, even when things get busy. For your case with 150 customers using voicebots, you have a few options to consider: • Assigning one agent per customer for strong isolation. • Using one agent per voicebot per customer if you want more granular control. • Or going with a single agent that uses dynamic configuration for simplicity and scalability. Which approach fits best really depends on what matters most to you—whether that’s isolation, scalability, or ease of management. Feel free to reach out if you'd like me to walk you through any of these options in more detail—I’m here to help! Sources: examples/voice_agents/llamaindex-rag/data/raw_data.txt | How We Built a Globally Distributed WebRTC Mesh Network | How We Built a Globally Distributed WebRTC Mesh Network | SECURITY.md | delay-handling/raw_data.txt
c
but what is the most common setup? and with scale plan I am only have 4 agents, is there any way to increase that limit?
t
I’m glad you asked about the setup for multitenant environments in LiveKit SaaS applications! Typically, we use the distributed mesh architecture along with multi-home capabilities to make sure you get low-latency connections and smooth automatic scaling, even when handling lots of participants. For your Scale plan, it usually includes a default limit of 50+ concurrent agent sessions and 50,000 agent session minutes per month. If you ever feel like you need more, you can easily request an increase right from the project settings dashboard. Plus, LiveKit Cloud has elastic scaling, so agent instances will automatically adjust to meet your demand, helping everything run seamlessly as your usage grows. If you’d like, I’m here to help walk you through requesting higher limits or setting up your environment the best way possible. Just let me know! Sources: Deploy and scale agents on LiveKit Cloud | delay-handling/raw_data.txt | examples/voice_agents/llamaindex-rag/data/raw_data.txt | LiveKit Pricing | Deploy and scale agents on LiveKit Cloud
c
I am talking abount quantity of deployed agents, not concurrent sessions
t
Thanks for reaching out! It looks like there isn’t specific information about increasing the number of deployed agents in the Scale plan, which usually centers around concurrent session limits and session minutes. To make sure we find the best solution for you, could you share a bit more about your goals? Are you hoping to deploy more agents for particular tasks, or are you looking to scale your infrastructure for a wider range of uses? Understanding this will really help us guide you in the right direction.
c
If I deploy 1 Agent per customer, at least in my actual situation, i will need 150 agents deployed. My question is how to increase that limit that I have in my actual plan
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!
c
How can scale with múltiple tenants ?