I am self hosting livekit's agent server and have ...
# ask-ai
m
I am self hosting livekit's agent server and have currently numIdleProcesses: 5, which means I have 5 worker processes right? how many calls can these 5 handle?
t
Thanks for reaching out, Soumyadeep. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're correct that
numIdleProcesses: 5
means the agent keeps 5 worker processes warmed and ready — but that doesn't strictly equal the total concurrent calls the server can handle. Key points: • Each worker handles one job at a time, and the agent can spawn additional processes beyond the 5 idle ones as load increases. •
numIdleProcesses
only reduces cold-start latency by keeping 5 ready; it does not cap concurrency. • Actual concurrent capacity depends on hardware (CPU, RAM, network), the work each call does (VAD/STT/LLM/TTS), and external API latency. Quick guidance: • With 5 idle processes you can immediately accept 5 calls with no warm-up delay; additional simultaneous calls will trigger new processes. • As a rough production guideline, a 4-core / 8 GB machine often handles ~10–25 concurrent jobs (and in one lightweight test reached ~30), but your mileage will vary. If you’d like, tell me: • your machine specs (CPU cores, RAM), • typical per-call workload (which processing steps you use), and I’ll help estimate expected concurrency and suggest test settings (load thresholds or scaling). Sources: Agent server options | LiveKit docs | Deploying to custom environments | LiveKit docs
m
how many worker processes can be deployed via auto trigger after 5 processes?
t
The agent can spawn additional worker processes beyond the 5 idle ones as needed — there is no fixed upper limit imposed by the agent itself. Total workers that can be created is constrained by your server's resources (CPU, memory, network) and any platform limits you set (OS process limits, container orchestrator quotas). To give a practical estimate for your setup, please share: • CPU cores and RAM of the host • Typical per-call load (which features: VAD, STT, LLM, TTS) • Any process / container limits you’ve configured (ulimits, Kubernetes resource requests/limits) I can then suggest expected max concurrent workers and recommended autoscaling thresholds.
m
what are the available thresholds
t
You're asking which thresholds control when the agent spawns additional worker processes and how they work — here's what's available and how to use them. • load_threshold ◦ The primary threshold that determines whether the agent accepts new jobs. If the computed load ≥
load_threshold
, the agent stops accepting new jobs. Default is 0.7. ◦ Use this to prevent accepting work when the host is too busy. • load_fnc ◦ A customizable function that returns a float 0.0–1.0 representing current load. By default it returns average CPU utilization over a 5‑second window. ◦ You can replace it to base load on active job count, memory, or any metric (example:
len(agent_server.active_jobs)/10
). • num_idle_processes (prewarm) ◦ Number of worker processes kept warmed and ready (your current
5
). This reduces cold-start latency but does not cap total workers. Operational guidance: • The agent spawns extra workers while the computed
load_fnc
value is below
load_threshold
. There is no hard-coded upper limit in the agent; maximum workers are constrained by host resources and any OS/container limits you set (ulimits, K8s quotas). • For autoscaling decisions at infra level, use the same metric as
load_fnc
and scale up at a lower threshold than
load_threshold
(for example, scale up infra at 0.5 if
load_threshold
is 0.7) so new capacity is ready before the agent stops accepting jobs. If you want specific numbers for your deployment, tell me: • host CPU cores and RAM • typical per-call workload (VAD/STT/LLM/TTS) • any container/OS process limits you’ve set Sources: Agent server options | LiveKit docs | Deploying to custom environments | LiveKit docs