my agents are hosted on my server and i am using l...
# ask-ai
c
my agents are hosted on my server and i am using livekit selhost creds and sometimes livekit cloud creds also but when i call concurrent 20 calls then only 10 calls are picked i opened 20 concurent mobile web call sessions by selfhost and only 10 calls were picked by agent? why not all were picked? check image attached, my livekit is selfhost and on same server my agent is hosted its hostinger KVM4 plan, also when i checked CPU usage in hostinger panel then it was only going to ~20% at the time of all these concurrent calls testing i want to use more CPU and more calls should be picked
✅ 1
t
Thanks for reaching out, Karrrtik. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking into why only 10 of 20 concurrent calls are being picked. A few likely causes and quick checks you can run now: What I’m responding to: your self‑hosted agent on the same Hostinger KVM4 server picks only 10 of 20 mobile web calls, while CPU is ~20% and you want more calls to be accepted. Likely causes • The AgentServer is enforcing a concurrency limit via its load function (
load_fnc
) or
load_threshold
even if CPU is low. • LiveKit server or agent process settings (participant/connection or job queue limits) are capping accepted sessions. • A single agent instance may be designed to handle a limited number of concurrent jobs; you may need horizontal scaling. Immediate checks (please run and share results) 1. Confirm AgentServer config: ◦ Do you have custom
load_fnc
or
load_threshold
set? If not, what are the defaults in your config file? 1. Check agent process logs when the 11th–20th calls arrive: ◦ Any errors about rejecting jobs, “agent busy”, or load rejections? 1. Verify LiveKit server limits: ◦ Any participant/room limits configured? 1. Confirm how many agent server instances are running on that host: ◦ Single instance vs multiple containers/processes? Short-term actions you can try • If
load_threshold
is limiting jobs, increase it or change
load_fnc
to count active jobs instead of CPU load. • Run a second agent instance on the same host (or another host) to increase parallel job capacity. • Check LiveKit server config for participant/room limits and raise them if present. If you share: • your AgentServer config (the options block with
load_fnc
/
load_threshold
), • the agent logs around when calls are rejected, I’ll give exact config changes or a concise next-step plan to allow more concurrent calls. Sources: Pricing | LiveKit | Pricing | LiveKit | Agents on LiveKit Cloud | Deploy voice AI on global infrastructure | LiveKi... | Self-hosted deployments | LiveKit Documentation | Server options | LiveKit Documentation, with interactive elements
c
my logs for concurrent many calls: {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "2ca95ac29c10", "pid": 537703, "job_id": "AJ_JKeQWnGuzbT9", "room_id": "RM_G5NAExFu4KDG", "timestamp": "2026-04-18T072916.080152+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "305ce941599c", "pid": 537693, "job_id": "AJ_XatgHWnuWpYf", "room_id": "RM_CqiVnSg3rDpj", "timestamp": "2026-04-18T072918.480005+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "0f3d7caa8681", "pid": 533934, "job_id": "AJ_Qp6ExMsLd8Fh", "room_id": "RM_Sqm7kJKLHhwu", "timestamp": "2026-04-18T072920.974222+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "f5ff4ab43fc1", "pid": 466074, "job_id": "AJ_jjMyfuqJmm5g", "room_id": "RM_wjn5zuk64dR5", "timestamp": "2026-04-18T072921.010527+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "11ef13dda94d", "pid": 534563, "job_id": "AJ_7XBrVeaQpnqc", "room_id": "RM_pnjoCSRum9Pi", "timestamp": "2026-04-18T072921.048994+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "f26c27e5b21a", "pid": 534730, "job_id": "AJ_VGxN5zQpLAmV", "room_id": "RM_GzT3mMC6twoK", "timestamp": "2026-04-18T072921.112798+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "d77e2dd47826", "pid": 537693, "job_id": "AJ_XatgHWnuWpYf", "room_id": "RM_CqiVnSg3rDpj", "timestamp": "2026-04-18T072921.138646+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "15cb5c6e7f41", "pid": 537703, "job_id": "AJ_JKeQWnGuzbT9", "room_id": "RM_G5NAExFu4KDG", "timestamp": "2026-04-18T072921.472301+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6621918999999998, "threshold": 0.7, "timestamp": "2026-04-18T072927.052856+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "17ecacfa89ff", "pid": 537703, "job_id": "AJ_JKeQWnGuzbT9", "room_id": "RM_G5NAExFu4KDG", "timestamp": "2026-04-18T072937.329358+00:00"} {"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 538816, "timestamp": "2026-04-18T072940.982002+00:00"} {"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 538816, "elapsed_time": 0.92, "timestamp": "2026-04-18T072941.900929+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "ae57ffcadc7e", "pid": 534730, "job_id": "AJ_VGxN5zQpLAmV", "room_id": "RM_GzT3mMC6twoK", "timestamp": "2026-04-18T072949.722463+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "5e0e294d9e93", "pid": 535754, "job_id": "AJ_EPsuL6HqKg2N", "room_id": "RM_Uxev2WUU2RG5", "timestamp": "2026-04-18T072950.942341+00:00"} {"message": "received job request", "level": "INFO", "name": "livekit.agents", "job_id": "AJ_a9DVJbkhtuTF", "dispatch_id": "AD_rNbrfTpRBKHs", "room": "room-3-f0d02b21", "room_id": "RM_tQNB9CUnKUdA", "agent_name": "sizh_agent", "resuming": false, "enable_recording": false, "timestamp": "2026-04-18T072953.507730+00:00"} {"message": "initializing process", "level": "INFO", "name": "livekit.agents", "pid": 538846, "timestamp": "2026-04-18T072954.486947+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.9156634999999997, "threshold": 0.7, "timestamp": "2026-04-18T072957.061733+00:00"} not authenticated {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "f285c69f8475", "pid": 535754, "job_id": "AJ_EPsuL6HqKg2N", "room_id": "RM_Uxev2WUU2RG5", "timestamp": "2026-04-18T072957.253806+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "d2a771ce725b", "pid": 537693, "job_id": "AJ_XatgHWnuWpYf", "room_id": "RM_CqiVnSg3rDpj", "timestamp": "2026-04-18T072957.263554+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "af9db04d2e07", "pid": 467715, "job_id": "AJ_q2NtdTRUgvf2", "room_id": "RM_sSw8yEnaPc9S", "timestamp": "2026-04-18T072957.275993+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "8274f9f8b7e8", "pid": 537703, "job_id": "AJ_JKeQWnGuzbT9", "room_id": "RM_G5NAExFu4KDG", "timestamp": "2026-04-18T072957.330542+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "a6696dcaa2d3", "pid": 533934, "job_id": "AJ_Qp6ExMsLd8Fh", "room_id": "RM_Sqm7kJKLHhwu", "timestamp": "2026-04-18T072957.506323+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "204d3bd8ae06", "pid": 534563, "job_id": "AJ_7XBrVeaQpnqc", "room_id": "RM_pnjoCSRum9Pi", "timestamp": "2026-04-18T072957.512542+00:00"} {"message": "process initialized", "level": "INFO", "name": "livekit.agents", "pid": 538846, "elapsed_time": 3.24, "timestamp": "2026-04-18T072957.731678+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "ea33ffc5b0dc", "pid": 537731, "job_id": "AJ_a9DVJbkhtuTF", "room_id": "RM_tQNB9CUnKUdA", "timestamp": "2026-04-18T072958.030954+00:00"} {"message": "inference is slower than realtime", "level": "WARNING", "name": "livekit.plugins.silero", "delay": 0.21451965395454317, "pid": 535754, "job_id": "AJ_EPsuL6HqKg2N", "room_id": "RM_Uxev2WUU2RG5", "timestamp": "2026-04-18T073001.752398+00:00"} {"message": "inference is slower than realtime", "level": "WARNING", "name": "livekit.plugins.silero", "delay": 2.620470423995517, "pid": 537731, "job_id": "AJ_a9DVJbkhtuTF", "room_id": "RM_tQNB9CUnKUdA", "timestamp": "2026-04-18T073004.576298+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.4935517999999998, "threshold": 0.7, "timestamp": "2026-04-18T073004.645180+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "67f760e0d609", "pid": 537731, "job_id": "AJ_a9DVJbkhtuTF", "room_id": "RM_tQNB9CUnKUdA", "timestamp": "2026-04-18T073005.470888+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.9257119999999999, "threshold": 0.7, "timestamp": "2026-04-18T073007.146965+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "fdd06334256c", "pid": 537703, "job_id": "AJ_JKeQWnGuzbT9", "room_id": "RM_G5NAExFu4KDG", "timestamp": "2026-04-18T073013.831262+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.6663357999999995, "threshold": 0.7, "timestamp": "2026-04-18T073014.649724+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.7006164999999994, "threshold": 0.7, "timestamp": "2026-04-18T073017.150423+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "9f5f84562e38", "pid": 535754, "job_id": "AJ_EPsuL6HqKg2N", "room_id": "RM_Uxev2WUU2RG5", "timestamp": "2026-04-18T073019.217817+00:00"} {"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.5806732999999993, "threshold": 0.7, "timestamp": "2026-04-18T073019.652256+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "a9e8c6bd6767", "pid": 467715, "job_id": "AJ_q2NtdTRUgvf2", "room_id": "RM_sSw8yEnaPc9S", "timestamp": "2026-04-18T073021.209538+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "5adb253108a8", "pid": 534563, "job_id": "AJ_7XBrVeaQpnqc", "room_id": "RM_pnjoCSRum9Pi", "timestamp": "2026-04-18T073021.291403+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "221a7aa47253", "pid": 466074, "job_id": "AJ_jjMyfuqJmm5g", "room_id": "RM_wjn5zuk64dR5", "timestamp": "2026-04-18T073021.300233+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "7a7db22aab57", "pid": 537693, "job_id": "AJ_XatgHWnuWpYf", "room_id": "RM_CqiVnSg3rDpj", "timestamp": "2026-04-18T073021.515328+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "02adca00f885", "pid": 535754, "job_id": "AJ_EPsuL6HqKg2N", "room_id": "RM_Uxev2WUU2RG5", "timestamp": "2026-04-18T073021.619496+00:00"} {"message": "Context created confirmed by server", "level": "INFO", "name": "livekit.plugins.inworld", "context_id": "63f5d1de8cbe", "pid": 537731, "job_id": "AJ_a9DVJbkhtuTF", "room_id": "RM_tQNB9CUnKUdA", "timestamp": "2026-04-18T073021.873233+00:00"} {"message": "worker is at full capacity, marking as unavailable", "level": "INFO", "name": "livekit.agents", "load": 0.8108918999999993, "threshold": 0.7, "timestamp": "2026-04-18T073022.154915+00:00"} my code: import os from dotenv import load_dotenv from livekit import agents load_dotenv() from services.llm.agent_service import entrypoint, prewarm URL = os.getenv("LIVEKIT_URL") KEY = os.getenv("LIVEKIT_API_KEY") SECRET = os.getenv("LIVEKIT_API_SECRET") AGENT_NAME = os.getenv("AGENT_NAME") AGENT_PORT = 8091 def main() -> None: agents.cli.run_app( agents.WorkerOptions( entrypoint_fnc=entrypoint, prewarm_fnc=prewarm, agent_name=AGENT_NAME, port=AGENT_PORT, api_key=KEY, api_secret=SECRET, ws_url=URL, ) ) if name == "__main__": main()
t
Thanks — I reviewed your logs and code. I’m responding to your question about why only ~10 of 20 concurrent calls are picked. What the logs show • Agent load behavior is the limiter: entries like "worker is at full capacity, marking as unavailable" with load values ~0.8–0.92 and threshold 0.7 indicate the agent process is refusing new jobs once load > 0.7. • Warnings like "inference is slower than realtime" show some plugins are increasing processing load per job. • The error "audio filter cannot be enabled: LiveKit Cloud is required" and "failed to fetch server settings: http status: 404" indicate some cloud-only features are attempted but not available — these are errors but not the root cause of the concurrency cap. • Your code uses default WorkerOptions without customizing load behavior, so default `load_fnc`/`load_threshold` are active. Immediate action items (please do and share results) 1. How many CPU cores does the Hostinger KVM4 plan provide on this VM? (I need cores count.) 2. Are you running a single agent process/instance on the host or multiple instances/containers? 3. Share any agent config file or environment variables that set
load_threshold
or
load_fnc
(if present). Recommendations to increase concurrent jobs • Increase allowed load or change load function: ◦ Set a higher
load_threshold
(e.g., 0.9) or supply a custom
load_fnc
that measures active job count instead of CPU. This lets the agent accept more jobs even if CPU is underutilized. • Horizontal scaling: ◦ Run additional agent instances (same host or other hosts). Multiple workers will distribute jobs and increase capacity. • Tune plugin/resource usage: ◦ Reduce per-job CPU by using lighter inference models or optimizing plugins (Silero warnings show inference delays). • Monitor realtime metrics: ◦ Track per-process CPU, memory, and per-job latency to ensure you don’t overload the VM. If you want, I can provide: • Exact code example showing how to pass
load_threshold
and a simple
load_fnc
to
agents.WorkerOptions
. • A checklist for spinning up a second agent instance and verifying job distribution. Tell me the CPU core count and whether you run one agent instance — then I’ll give the exact configuration snippet to try next. , with interactive elements
c
4 vCPU cores included in KVM4 i am running single agent by code which i pass u in above chat i havent set any
load_threshold
or
load_fnc
t
Thanks — I’ve reviewed your latest info (4 vCPUs, single agent process, no custom load settings) and your logs. I’m responding to why only ~10 of 20 calls are picked and how to increase concurrency. Root cause (what logs show) • The agent uses the default CPU-based load function and default
load_threshold=0.7
. Logs like "worker is at full capacity, marking as unavailable" with load ≈0.8–0.92 show the agent is refusing new jobs once measured load exceeds 0.7 even though overall CPU appears under 100%. • Inference warnings ("inference is slower than realtime") increase per-job CPU/latency, which raises the agent load metric and triggers capacity flags. Concrete next steps you can apply now 1) Quick: raise the threshold • Change
WorkerOptions
to set a higher
load_threshold
(for example 0.9) so the agent accepts more jobs before marking unavailable. 2) Better: use a job-count load function • Replace the default CPU-based
load_fnc
with one that measures active jobs, e.g. limit to 20 concurrent jobs:
Copy code
def job_count_load(server) -> float:
    # allow up to 20 concurrent jobs
    return min(len(server.active_jobs) / 20.0, 1.0)

agents.cli.run_app(
    agents.WorkerOptions(
        entrypoint_fnc=entrypoint,
        prewarm_fnc=prewarm,
        agent_name=AGENT_NAME,
        port=AGENT_PORT,
        api_key=KEY,
        api_secret=SECRET,
        ws_url=URL,
        load_threshold=0.9,
        load_fnc=job_count_load,
    )
)
3) Scale horizontally (recommended for production) • Run a second agent instance (same host or another VM). Two 4‑vCPU agents will roughly double concurrent capacity and avoid overloading a single process. 4) Tune per-job cost • Replace or optimize heavy plugins/models (Silero inference warnings) to reduce per-call CPU and latency so more jobs can run concurrently. What I need from you to finalize: • Do you want a job-count cap (example above) or simply to raise the
load_threshold
? • If you want, I can give a one-line command to run a second agent instance on the same VM. Which option would you like to try first? Sources: Server options | LiveKit Documentation | Voice Agent Architecture: STT, LLM, and TTS Pipelines Explained | LiveKit | Self-hosted deployments | LiveKit Documentation, with interactive elements