if i self host the agent and are on the livekit fr...
# ask-ai
w
if i self host the agent and are on the livekit free plan, are there any limitations in terms of workers / agents joining rooms? or just the RTC limits, i.e. 100 max concurrent, and max minutes total?
t
Thanks for reaching out, Jimmy. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're right to ask—when you self-host agents on the LiveKit free (Build) plan, the limits you hit are the RTC/usage quotas of that free project. Quick summary: • Each self-hosted agent that joins a room counts as a participant toward the 100 concurrent participant cap. • Agent connection time consumes the 5,000 WebRTC participant minutes / month quota (and other metered quotas like downstream data). • Other media quotas (track egress, transcode minutes, data transfer) also apply. • The Cloud-hosted agent-specific limits (e.g., agent session minutes and agent concurrency caps) do not apply when you self-host agents. If you'd like, tell me your expected concurrent agents and average session length and I can estimate monthly minutes and whether you'll hit the free-tier caps. Sources: Quotas and limits | LiveKit docs | LiveKit Pricing
w
my agent was running fine but suddenly i am getting "runner initialization timed out" why is this?
t
Thanks — I’ll help troubleshoot the "runner initialization timed out" error. A few likely causes and quick checks first, then a couple of targeted questions to narrow it down. Possible causes & quick checks • Cold start delay: If your agent host scales from zero, cold starts can add 10–20s. Did this happen after a period of inactivity? • Recent deploy/build: If you recently deployed or rebuilt the image, check whether the build exceeded the 10‑minute build timeout or failed during deploy. • Resource starvation: CPU or memory limits (or exhausted AWS CPU credits on t3/t4) can slow startup. Check CPU/memory usage and container restarts. • Startup command: Ensure your container’s `ENTRYPOINT`/`CMD` launches the agent directly (no backgrounding or wrappers). • Draining/shutdown behavior: If the host received SIGTERM/SIGINT during rollout, runners may be draining; verify any rolling-deploy or autoscaler activity. • Logs: Look for errors or long pauses in the agent startup logs immediately before the timeout. Please provide 1. Are you running agents on LiveKit Cloud or self‑hosted? 2. Any recent deploys, config changes, or platform updates just before the error started? 3. Short log snippet around the initialization attempt (first 30–60s) showing timestamps and any WARN/ERROR lines. 4. Your runtime environment (Docker, k8s, AWS ECS, VM) and instance type/limits. If you want, I can prioritize checks based on your answers (logs first if available). Sources: Quotas and limits | LiveKit docs | Builds and Dockerfiles | LiveKit Docs | Deploying to custom environments | LiveKit Docs | Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | Agent server options | LiveKit docs
w
i'm seeing this log
Copy code
2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] file:///app/node_modules/.pnpm/@livekit+agents@1.0.17_@livekit+rtc-node@0.13.20_zod@4.1.13/node_modules/@livekit/agents/dist/ipc/supervised_proc.js:114

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] throw err;

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] ^

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] Error: runner initialization timed out

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] at Timeout._onTimeout (file:///app/node_modules/.pnpm/@livekit+agents@1.0.17_@livekit+rtc-node@0.13.20_zod@4.1.13/node_modules/@livekit/agents/dist/ipc/supervised_proc.js:112:19)

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] at listOnTimeout (node:internal/timers:605:17)

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] at process.processTimers (node:internal/timers:541:7)

2025-11-27T01:57:46.164 app[48edde1a312118] syd [info] Node.js v25.2.1
t
Thanks — that log confirms the supervised process timed out while waiting for the agent runner to initialize. Let's troubleshoot with focused checks. What this log shows • The agent's supervised process threw "runner initialization timed out" while waiting for the child runner to come online. • Timeout occurs inside
supervised_proc.js
, meaning the supervisor never observed a healthy runner start before its timer expired. Please check (in this order) 1. Recent deploy/restart: Did you just deploy a new image or restart the service? If yes, share that timeframe. 2. Startup command: Ensure your container `ENTRYPOINT`/`CMD` launches the agent directly (no backgrounding or wrappers). If you use a shell script, confirm it execs the agent process. 3. Logs earlier than the snippet: Send the 30–60s of logs immediately before the error (start of container / process stdout). That often shows why the runner didn't signal readiness. 4. Resource constraints: Confirm CPU/memory limits and whether the host is on burstable instances (t3/t4). Share container OOM/restart counts and CPU throttling metrics. 5. Cold start / scale-to-zero: If platform scales from zero, did this occur after inactivity? Cold starts can add ~10–20s. 6. Dependency or build problems: Any recent package changes, native dependency installs, or long build steps? Builds that hang or fail can prevent runner start. If you can, provide • The pre-timeout log lines (30–60s) and any WARN/ERROR messages. • How you run the agent (Docker locally, Kubernetes, ECS, Heroku, LiveKit Cloud) and instance type/limits. • Your Dockerfile `ENTRYPOINT`/`CMD` (or startup script). I’ll prioritize the logs once you paste them and suggest the exact fix (startup command change, resource increase, or build adjustment).
w
here are some more logs
Copy code
2025-11-27T03:26:38.341 app[48edde1a312118] syd [info] 2025-11-27T03:26:38.341564806 [01KB171J2J6F82D4MPPJDFB8Y3:main] Running Firecracker v1.12.1

2025-11-27T03:26:38.341 app[48edde1a312118] syd [info] 2025-11-27T03:26:38.341760029 [01KB171J2J6F82D4MPPJDFB8Y3:main] Listening on API socket ("/fc.sock").

2025-11-27T03:26:39.842 app[48edde1a312118] syd [info] INFO Starting init (commit: 6f59af0a)...

2025-11-27T03:26:40.334 app[48edde1a312118] syd [info] INFO Preparing to run: `docker-entrypoint.sh node .dist/agent.js start` as appuser

2025-11-27T03:26:40.409 app[48edde1a312118] syd [info] INFO [fly api proxy] listening at /.fly/api

2025-11-27T03:26:40.717 runner[48edde1a312118] syd [info] Machine started in 2.429s

2025-11-27T03:26:47.122 app[48edde1a312118] syd [info] 2025/11/27 03:26:46 INFO SSH listening listen_address=[fdaa:1d:1e64:a7b:f5:ea97:20ff:2]:22

2025-11-27T03:26:57.765 app[48edde1a312118] syd [info] (node:643) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///app/.dist/agent.js is not specified and it doesn't parse as CommonJS.

2025-11-27T03:26:57.765 app[48edde1a312118] syd [info] Reparsing as ES module because module syntax was detected. This incurs a performance overhead.

2025-11-27T03:26:57.765 app[48edde1a312118] syd [info] To eliminate this warning, add "type": "module" to /app/package.json.

2025-11-27T03:26:57.765 app[48edde1a312118] syd [info] (Use `node --trace-warnings ...` to show where the warning was created)

2025-11-27T03:27:14.162 app[48edde1a312118] syd [info] Decoded GCP credentials from environment variable

2025-11-27T03:27:14.246 app[48edde1a312118] syd [info] {"level":30,"time":1764214034245,"pid":643,"hostname":"48edde1a312118","version":"0.1.0","msg":"starting worker"}

2025-11-27T03:27:15.601 app[48edde1a312118] syd [info] {"level":30,"time":1764214035450,"pid":643,"hostname":"48edde1a312118","msg":"Server is listening on port 8081"}

2025-11-27T03:27:16.962 app[48edde1a312118] syd [info] {"level":30,"time":1764214036962,"pid":643,"hostname":"48edde1a312118","version":"0.1.0","id":"AW_tXwGyBJWD4ky","server_info":{"edition":"Cloud","version":"1.9.4","protocol":16,"region":"Australia","nodeId":"NC_OSYDNEY1A_Jn7AsHGuuVhn","debugInfo":"","agentProtocol":0},"msg":"registered worker"}

2025-11-27T03:27:24.723 app[48edde1a312118] syd [info] file:///app/node_modules/.pnpm/@livekit+agents@1.0.17_@livekit+rtc-node@0.13.20_zod@4.1.13/node_modules/@livekit/agents/dist/ipc/supervised_proc.js:114

2025-11-27T03:27:24.723 app[48edde1a312118] syd [info] throw err;

2025-11-27T03:27:24.723 app[48edde1a312118] syd [info] ^

2025-11-27T03:27:24.723 app[48edde1a312118] syd [info] Error: runner initialization timed out
t
Thanks — the logs are helpful. You reached the point where the worker registers with LiveKit but the supervised runner never signals readiness, so the supervisor throws "runner initialization timed out." Focused steps to fix this: 1. Fix the ES module warning • Add
"type": "module"
to your package.json to avoid reparsing overhead that can delay startup. 1. Verify startup command • Ensure your Dockerfile `ENTRYPOINT`/`CMD` directly execs the agent start (no backgrounding or wrapper scripts). Example:
CMD ["node", ".dist/agent.js", "start"]
or
ENTRYPOINT ["pnpm","start"]
that execs the process. 1. Check required env vars/secrets • Confirm
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, and any cloud creds are present at runtime (not only at build). Missing runtime secrets can hang init. 1. Resource and cold-start checks • Ensure enough CPU/memory and that the host isn’t CPU-throttled (watch CPU credits on t3/t4). Cold starts or heavy model loading can push init past the timeout. 1. Inspect earlier startup logs and enable debug • Share the 10–30s of logs immediately after
Server is listening on port 8081
up to the timeout. Enable verbose/debug logging in the agent to capture why the runner didn’t report ready. 1. Consider increasing timeout temporarily • If your runner legitimately needs more time to initialize (large models, prewarming), set a larger timeout via the agent-runner timeout env var if your deployment supports it (e.g.,
AGENT_RUNNER_TIMEOUT
) while you diagnose. What I need next to pinpoint the root cause • The 10–30s log lines after
"Server is listening on port 8081"
(you already posted some; include any WARN/ERROR lines right after that). • Your Dockerfile `ENTRYPOINT`/`CMD` or startup script. • Runtime environment (Fly, k8s, ECS, VM) and instance sizing or CPU/memory limits. If you want, paste the startup script and next log chunk and I’ll point out the exact change to make. Sources: Streamline Troubleshooting with Agent Observability | Deploying to production | LiveKit Docs | Builds and Dockerfiles | LiveKit Docs | Agents (Node.js) | livekit/livekit_composite | DeepWiki | Agent server options | LiveKit docs