straight-jelly-92105
10/29/2025, 7:56 PMtall-airline-16756
10/29/2025, 7:56 PMtall-airline-16756
10/29/2025, 7:57 PMload_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 Docsstraight-jelly-92105
10/29/2025, 8:00 PMtall-airline-16756
10/29/2025, 8:00 PMload_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:
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:
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.tsstraight-jelly-92105
10/29/2025, 8:09 PMtall-airline-16756
10/29/2025, 8:10 PMjob_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