miniature-oil-11138
11/28/2025, 8:50 AMtall-airline-16756
11/28/2025, 8:50 AMtall-airline-16756
11/28/2025, 8:50 AMagent_name) to balance traffic.
• Enable autoscaling (or configure it if self-hosting): Scale workers based on CPU or active session metrics so capacity grows before limits are hit.
• Optimize agent code: Reduce blocking operations and lower CPU/memory usage so each worker supports more sessions.
• Monitor and request increases: Watch agent session counts in the LiveKit Cloud dashboard and request higher concurrency from project settings if needed.
If you tell me your project plan (Build vs Scale/Enterprise), current agent replica count, and whether you’re using LiveKit Cloud autoscaling, I can recommend the best immediate next step and specific configuration changes. Would you like that?
Sources: Quotas and limits | LiveKit docs | Deploying to custom environments | LiveKit Docs | Deploying to production | LiveKit Docs | LiveKit Pricing | Deploy and scale agents on LiveKit Cloudminiature-oil-11138
11/28/2025, 8:51 AMminiature-oil-11138
11/28/2025, 8:51 AMtall-airline-16756
11/28/2025, 8:51 AMagent_name routing: Dispatch users to specific agents to balance connections across replicas.
• Enable/configure autoscaling: Scale workers by CPU or active-session metrics so capacity grows before limits are reached.
• Optimize agent code: Reduce blocking work or heavy CPU use so each worker can handle more sessions.
• Monitor and adjust: Watch active session counts in the dashboard and scale replicas or request higher concurrency if needed.
Tell me how many replicas you currently run and whether autoscaling is enabled, and I’ll give concrete commands/config suggestions for adding replicas or configuring autoscaling on Ship.miniature-oil-11138
11/28/2025, 8:51 AMtall-airline-16756
11/28/2025, 8:52 AMminiature-oil-11138
11/28/2025, 8:53 AMtall-airline-16756
11/28/2025, 8:53 AMload_threshold (default 0.7). If measured load ≥ 0.7 the worker rejects new jobs as “full capacity.”
• Local machines have limited CPU/memory compared with cloud nodes, so it’s easier to hit that threshold.
• LiveKit Cloud can spin up more replicas; your local setup runs as a single instance unless you start more manually.
What you can do right now
• Increase local resources: run on a machine with more cores/RAM (recommend ≥4 cores, 8GB RAM for voice AI workloads).
• Run multiple local workers: start several worker processes (or containers) to distribute load.
• Change load behavior (local only): override load_fnc and/or load_threshold in your AgentServer config to use a different metric or higher threshold. Example pattern:
AgentServer(
load_fnc=my_custom_load, # e.g., count of active jobs
load_threshold=0.85,
)
• Optimize agent code: remove blocking operations, offload heavy model inference, or use lighter instance types for inference to lower per-session CPU.
• Monitor: watch CPU, memory, and active session counts so you can add instances before reaching the threshold.
If you want, tell me:
• how many concurrent sessions you try to run locally, and
• whether your worker runs heavy CPU tasks (model inference) —
and I’ll suggest the exact load_fnc example or commands to start multiple worker instances.
Sources: Agent server options | LiveKit docs | Deploying to custom environments | LiveKit Docs | Deploy and scale agents on LiveKit Cloud | examples/drive-thru | livekit/livekit_composite | DeepWiki