{"message": "worker is below capacity, marking as ...
# ask-ai
s
{"message": "worker is below capacity, marking as available", "level": "INFO", "name": "livekit.agents", "load": 0.556, "threshold": "_WorkerEnvOption(dev_default=inf, prod_default=0.7)", "timestamp": "2025-10-29T194558.396643+00:00"}
t
Thanks for reaching out, ABHIRAM. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for reaching out! The log message "worker is below capacity, marking as available" is actually a helpful indicator. It means that one of your worker nodes has been checked and is currently running below its set load limit, so it’s ready to take on new jobs. This is determined by looking at the worker’s current load, which is measured using the
load_fnc
function—usually this reflects the average CPU usage over a 5-second period. This load is then compared to the
load_threshold
parameter, which is set to 0.7 by default. When the load is below this threshold, the system updates the worker’s status to
WorkerStatus.WS_AVAILABLE
and logs this message to let you know that the worker can now handle more tasks. This smart approach helps LiveKit distribute work evenly across all workers by keeping an eye on their real-time resource usage, ensuring everything runs smoothly. If you have any more questions or need further clarification, I’m here to help! Sources: Deploying to custom environments | LiveKit Docs | Worker options | LiveKit Docs | README.md | livekit-agents/livekit/agents/worker.py | Worker lifecycle | LiveKit Docs
s
how can i increase the load threshold
t
I'm glad you're looking to adjust the load threshold for workers in LiveKit! To do this, you’ll want to tweak the
load_threshold
parameter within the
WorkerOptions
configuration when you start your worker. This change helps your worker take on more jobs before it's considered unavailable. Here’s a simple example in Python to guide you:
Copy code
from livekit.agents import WorkerOptions

worker_options = WorkerOptions(
    entrypoint_fnc=your_entrypoint_function,
    load_threshold=0.9,  # Increased threshold
    # other options...
)
And if you’re working with Node.js, it looks like this:
Copy code
const { WorkerOptions } = require('livekit-agent');

const workerOptions = new WorkerOptions({
  agent: './agent.js',
  loadThreshold: 0.9, // Increased threshold
  // other options...
});
Just a couple of important things to keep in mind: • For LiveKit Cloud deployments, custom
load_threshold
settings aren’t supported, so any changes will automatically revert to the default. • If you’re running a custom deployment, it’s a good idea to make sure your autoscaling strategy uses a lower threshold for scaling up than your worker’s
load_threshold
. This helps keep your service running smoothly. • Also, if CPU utilization isn’t the best fit for your needs, you have the option to customize the load calculation function (
load_fnc
), which is pretty handy. Sources: livekit-agents/livekit/agents/worker.py | Deploying to custom environments | LiveKit Docs | Worker options | LiveKit Docs | agents/src/worker.ts
s
{"message": "The room connection was not established within 10 seconds after calling job_entry. This may indicate that job_ctx.connect() was not called. ", "level": "WARNING", "name": "livekit.agents", "pid": 40362, "job_id": "AJ_YG7rtRhLDao3", "timestamp": "2025-10-29T200845.022758+00:00"} {"message": "livekit:rtc engine401livekit:rtc_engine - failed to connect: Connection(\"wait_pc_connection timed out\"), retrying... (1/3)", "level": "WARNING", "name": "livekit", "pid": 40362, "job_id": "AJ_YG7rtRhLDao3", "timestamp": "2025-10-29T200851.293446+00:00"} {"message": "process exiting", "level": "INFO", "name": "livekit.agents", "reason": "", "pid": 40362, "job_id": "AJ_YG7rtRhLDao3", "timestamp": "2025-10-29T200851.852244+00:00"}
t
I understand how the log message "The room connection was not established within 10 seconds after calling job_entry" can be a bit confusing. It basically means that the agent wasn’t able to connect to the assigned room within the expected 10 seconds after starting the job. This usually happens if the
job_ctx.connect()
method isn’t called early enough in the agent’s entrypoint function. Here are a few steps that might help you get this sorted out: • Make sure your agent code explicitly calls
job_ctx.connect()
early on in the entrypoint function. • Double-check that your deployment has enough dedicated worker instances to handle incoming jobs smoothly. • Look into whether other applications on the same server might be competing for resources. • Take a look at your load balancing or auto-scaling settings to confirm they’re set up to support your workload effectively. If you try these and still run into trouble, please don’t hesitate to reach out—I’m here to help you through it! Sources: livekit-agents/livekit/agents/job.py | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | How to Get Help from LiveKit