Why does the agent in livekit cloud go to sleep?
# ask-ai
b
Why does the agent in livekit cloud go to sleep?
t
Thanks for reaching out, Timothy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — great question. You’re asking why an agent in LiveKit Cloud might “go to sleep.” Here’s a concise explanation and what to check if you see that behavior. Short answer • LiveKit Cloud agents do not “go to sleep” in the traditional sense. On paid plans agents are kept warm and ready so they can accept connections with millisecond latency. • What can make an agent appear inactive is hitting deployment limits or being on a limited/free tier where resources are scaled down. Why this happens • Agents are stateful and normally remain active during sessions to keep low latency and avoid cold starts. • LiveKit enforces a hard ceiling on how many agents can run simultaneously because idle agents still reserve CPU, memory, and network resources. If your deployment hits that ceiling, new agent instances may not start immediately, which can look like them being “asleep.” • Free or limited tiers may use more aggressive scaling to save cost, so agents may not be kept warm 24/7 on those tiers. What to check / next steps • Confirm your plan/tier: paid plans keep agents warm and ready. • Check agent deployment limits: see whether you’ve hit the maximum concurrent agents for your account or region. • Look at recent scaling events or logs: these will show whether an agent was shut down for resource limits or never started because of quotas. • If you can share your plan (free vs. paid), the observed behavior, and any error/log messages, I can help interpret those and recommend the best next step. If you want, I can walk through where to find deployment limits and relevant logs in your account — tell me which plan you’re on and any symptoms you’ve seen (e.g., delayed connection time, errors, or no logs). Sources: Pricing | LiveKit | Can you increase agent deployment limits? | LiveKit | Deploy and scale agents on LiveKit Cloud
b
I'm on the build plan with only one active agent
Does this mean my agents won't be kept warm?
t
Thanks — that helps. You said you’re on the Build plan with one active agent, so here’s what to expect and what to check. What likely happened • On the Build plan a single agent can be subject to more aggressive resource management than paid/production tiers. That can make the agent appear to “go to sleep” (idle shutdown or not being kept warm), even though agents are stateful when active. • If the account or region enforces limits (for example a hard ceiling of concurrent agents), the platform may scale down idle agents to free resources. With only one agent in the Build plan, that single instance may be stopped when idle. What symptoms to look for • Longer-than-expected connection times (a short delay before the agent accepts the first connection). • Logs showing a graceful shutdown or service stop for the agent. • No agent process or room present in the control plane when you expect it to be running. Concrete checks you can do now 1. Check logs around the time you noticed inactivity for messages like shutdown, stopped, or idle timeout. 2. Confirm whether you see a scaling event (agent terminated or deprovisioned) in the deployment/usage UI. 3. Try connecting immediately after creating a room and note the time-to-connect; if it’s noticeably longer on the first connection, that often indicates a cold start. 4. Note any error messages or status codes returned by clients when a connection fails or is delayed. If you share: • The exact symptom (slow first connection, refused connection, room missing), • Any log snippets or timestamps around the incident, I can help interpret them and recommend next steps (for example, keeping an agent warm, upgrade options, or specific troubleshooting commands). Would you like guidance on where to find the agent logs and scaling events in your dashboard, or can you paste a short log excerpt/timestamp for me to review?
Thanks — I see you’re on the Build plan with one active agent. Short answer: agents on the Build plan are not kept warm and can experience cold starts (they can “go to sleep” when idle). What that means for you • Initial connections may have higher latency while the agent container spins up. • Because the Build plan doesn’t include cold-start prevention, agents won’t be kept warm 24/7. • Keeping one active agent on Build may still be fine for development, but you’ll see slower first-response times after idle periods. What you can do next • If you need consistently low latency and instant responses, upgrade to the Ship plan or higher — those plans keep agents warm to avoid cold starts. • If you want, tell me how often your agent is idle and how sensitive your app is to the initial latency; I can suggest whether the Ship plan is likely worth it or recommend workarounds for Build (for example, periodic keep-alive traffic to reduce spin-up frequency). Which would you like to do: discuss upgrade options, or explore keep-alive/workaround approaches for the Build plan? Sources: How to match the latency of the homepage agent | LiveKit
b
I do have slow first connections and sometimes the agent refuses to connect
t
Thanks — I hear you: you’re on the Build plan, you’re seeing slow first connections, and sometimes the agent refuses to connect. That’s frustrating — here’s what’s happening and what you can do next. Why this happens • Build-plan agents are not kept warm. When idle, their containers are de-provisioned to save cost, so the first request must wait for the agent to spin up and load models — this causes slow initial connections and can cause connection refusals if the spin-up takes too long. • Paid plans starting at Ship keep agents warm to avoid cold starts and give instant, low-latency responses. Build is intended for development/prototyping and does not include cold-start prevention. Immediate options to fix or mitigate 1. Upgrade to Ship (or higher) ◦ This is the most reliable fix. Ship-tier agents are kept warm and will eliminate the cold-start latency and most connection refusals. 1. Mitigate while staying on Build ◦ Send periodic keep-alive traffic so the agent stays active longer (reduces how often it must spin up). ◦ Prewarm heavy models during your agent’s startup so they aren’t loaded on the first user request. Example pattern (conceptual):
Copy code
def prewarm(proc: JobProcess):
         proc.userdata["vad"] = silero.VAD.load()
     server.setup_fnc = prewarm
Note: prewarming helps but cannot fully prevent cold-start delays because the container itself may still need to boot. What I recommend • If you need consistent low-latency and reliability for production traffic, upgrade to Ship or higher. • If you’re not ready to upgrade, try keep-alives + model prewarm and tell me the timing/latency you observe so I can help tune the approach. If you want, tell me: • How long the initial connection delay typically is (approx seconds). • Any error messages or logs when the agent refuses to connect. With those details I’ll help you choose the best next step and give more specific troubleshooting or prewarm code. Sources: Deploy and scale agents on LiveKit Cloud | How to match the latency of the homepage agent | LiveKit