I have deployed my worker on livekit cloud but get...
# ask-ai
m
I have deployed my worker on livekit cloud but getting these errors at times: worker is at full capacity => what causes it and how to fix it
t
Thanks for reaching out, Harshita. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you’re seeing the “worker is at full capacity” error because the agent worker handling sessions has hit its concurrency limit and cannot accept new sessions. Below are the likely causes and practical steps you can take right away. What causes it • Your project’s concurrency limit has been reached (free/Build projects default to 5 concurrent agent sessions). • Not enough agent replicas are running to handle traffic spikes. • Cold starts on lower-tier plans (agents scaled to zero) can make capacity look exhausted during wake-up. How to fix it • Upgrade plan: Move to a paid plan (Scale/Enterprise) to raise concurrency limits and avoid cold starts. • Run more agent instances: Deploy additional replicas or multi-region instances so load is distributed. You can dispatch users to specific agents (use
agent_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 Cloud
m
i am on the ship plan
how to configure replica count
t
Thanks — since you’re on the Ship plan, the error still means your agent worker hit its concurrency limit and can’t accept new sessions. On Ship this commonly happens when traffic exceeds the plan’s concurrent-agent capacity or when there aren’t enough replicas running to absorb spikes (cold starts can also contribute). Recommended next steps • Increase replicas: Deploy additional agent instances so load is distributed across workers. • Use
agent_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.
m
how to increase replicas?
t
Thanks — quick answer: you cannot manually set replica count on the Ship plan. LiveKit Cloud auto-scales agent replicas and is limited by your plan’s concurrency quota (Ship = 20 concurrent agent sessions) and the agent load threshold (default 0.7 CPU). When agents reach that load, they stop accepting new sessions and LiveKit will try to spin up more replicas until you hit the plan limit — at which point you see “worker is at full capacity.” What you can do now • Optimize agent resource use: reduce blocking work or heavy models so each replica supports more sessions. • Use non-burstable instance types or lighter inference workloads to avoid CPU spikes. • Monitor usage in the dashboard and watch CPU/load metrics to catch spikes early. • Upgrade plan if you need >20 concurrent sessions (Scale/Enterprise increases concurrency). If you want, tell me: • typical concurrent sessions you see, and • whether your agents run heavy CPU tasks (models, processing) — and I’ll suggest concrete optimizations or whether a plan upgrade is the right move.
m
but why does it happen when running the worker locally?
t
Short answer: it happens locally because your single local worker hits its load threshold and there’s no automatic horizontal scaling to absorb new sessions. Why that happens • Local workers use a load function (by default average CPU over 5s) and a
load_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:
Copy code
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