gray-carpet-66596
10/28/2025, 11:03 AMtall-airline-16756
10/28/2025, 11:03 AMtall-airline-16756
10/28/2025, 11:04 AMWorkerOptions, focusing on stability, resource management, and scalability will really pay off. Here are some friendly recommendations to guide you:
• Set production: true to activate those helpful production-specific defaults.
• Load Threshold: Try using loadThreshold: 0.7 to keep your workers from getting overloaded.
• Idle Processes: Matching numIdleProcesses to your number of CPU cores usually gives you smooth performance.
• Memory Management: It’s a good idea to set jobMemoryWarnMB (around 500MB) and, if you want, jobMemoryLimitMB to keep an eye on memory usage.
• Health Checks: Stick with the default port 8081 for monitoring the health of your workers.
• Timeouts: Consider setting shutdownProcessTimeout to 60 seconds and initializeProcessTimeout to 10 seconds to help with graceful scaling and startup.
• Secure Configuration: For your safety, use environment variables for LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and LIVEKIT_URL instead of hardcoding them.
One more tip: make sure your wsURL points to your LiveKit server (like wss://livekit.yourdomain.com) and that you have valid SSL certificates in place. As you go along, keep an eye on how your setup performs under real-world load and feel free to tweak numIdleProcesses and memory settings to find what works best for you.
Sources: agents/src/worker.ts | livekit-agents/livekit/agents/worker.py | Deploying to custom environments | LiveKit Docs | Deploying LiveKit | LiveKit Docs | Worker options | LiveKit Docs