average-knife-77348
11/07/2025, 10:01 PMtall-airline-16756
11/07/2025, 10:01 PMtall-airline-16756
11/07/2025, 10:02 PMWorkerOptions class. For example, in Python:
from livekit.agents import WorkerOptions
worker = Worker(
opts=WorkerOptions(
entrypoint_fnc=job_entrypoint,
job_memory_warn_mb=800, # Set warning at 800MB
job_memory_limit_mb=2048 # Kill job if it exceeds 2GB
),
# other parameters
)
• Make sure your system has enough memory available. For heavier applications, LiveKit suggests at least 8GB of memory per worker instance.
• If it fits your use case, try using rtc.AudioStream instead of RecorderIO for shorter audio snippets to help ease memory usage.
Please feel free to reach out if you’d like any help with these settings or have more questions—I’m here to help!
Sources: Capturing the First Few Seconds of a Call for Processing | Deploying to custom environments | LiveKit Docs | livekit-agents/livekit/agents/worker.py | agents/src/ipc/supervised_proc.tsaverage-knife-77348
11/07/2025, 10:03 PMtall-airline-16756
11/07/2025, 10:04 PMjob_memory_warn_mb and job_memory_limit_mb settings in your WorkerOptions configuration to better suit your needs.
3. Scale Resources: Make sure your infrastructure matches the recommended specs. For most voice AI apps, LiveKit suggests 4 CPU cores and 8 GB of RAM per worker to keep things running smoothly.
4. Use Dedicated Instances: It’s a good idea to choose dedicated compute instances (like m5 or c5) over burstable types (such as AWS t3/t4) to maintain consistent performance.
5. Optimize Workloads: If you’re using features that demand more memory, like enhanced noise cancellation, think about ways to optimize your app to ease the memory load.
If you have any questions or want a hand with these steps or your specific setup, please feel free to reach out. I’m here to help!
Sources: agents/src/ipc/supervised_proc.ts | Deploying to custom environments | LiveKit Docs | Deploying to custom environments | LiveKit docs | Troubleshooting Latency and Timeout Errors with Turn Detection on AWS | steam-headless/overlay/etc/cont-init.d/11-setup_sysctl_values.shaverage-knife-77348
11/07/2025, 10:04 PMtall-airline-16756
11/07/2025, 10:05 PMjob_memory_warn_mb and job_memory_limit_mb settings in your WorkerOptions. For instance, setting a warning at 700 MB and a hard limit at 1 GB might work well:
worker_options = WorkerOptions(
job_memory_warn_mb=700,
job_memory_limit_mb=1024,
# ... other options
)
1. Verify Job Execution Type: It’s important to make sure you’re using process-based job execution (JobExecutorType.PROCESS), because memory limits apply only when this type is selected.
2. Scale Resources: For a smooth production experience, starting with 4 CPU cores and 8 GB of RAM per worker is a good baseline. You can always adjust this depending on your workload.
3. Optimize Code: Try to reduce memory usage by cleaning up unused objects, using streaming methods for large data, and keeping an eye out for any memory leaks in third-party libraries.
4. Monitor System Memory: If you’re working in container environments, tools like cgroupMemoryGetter can be really helpful for tracking memory usage effectively.
If you’d like, I’m here to help you walk through these configurations or troubleshoot any issues. Just let me know!
Sources: livekit-agents/livekit/agents/worker.py | agents/src/ipc/supervised_proc.ts | Deploying to custom environments | LiveKit Docs | utils/hwstats/memory_linux.go | steam-headless/overlay/etc/cont-init.d/11-setup_sysctl_values.shaverage-knife-77348
11/07/2025, 10:06 PMtall-airline-16756
11/07/2025, 10:06 PMresources field, where you specify requests and limits for your containers.
Please feel free to reach out if you’d like more details or any help with scaling in LiveKit Cloud or your custom deployments—I’m here to support you!
Sources: Deploying to custom environments | LiveKit docs | Deploy and scale agents on LiveKit Cloud | examples/server-do.yamlaverage-knife-77348
11/07/2025, 10:15 PMtall-airline-16756
11/07/2025, 10:16 PMjob_memory_warn_mb and job_memory_limit_mb based on your use case. I hope this helps you get started smoothly:
• Basic Voice AI Applications:
- `job_memory_warn_mb`: 800-1000 MB
- `job_memory_limit_mb`: 1500-2000 MB
• Enhanced Feature Applications (e.g., noise cancellation):
- `job_memory_warn_mb`: 1500-2000 MB
- `job_memory_limit_mb`: 3000-4000 MB
• Production Environments:
- `job_memory_warn_mb`: 1000-1500 MB
- `job_memory_limit_mb`: 2500-3000 MB
It’s a good idea to start with these values and keep an eye on how memory usage behaves under load. This way, you can adjust things perfectly for your setup. If you’d like, I’m here to help you with any specific configurations or testing you might need—just let me know!
Sources: tests/test_ipc.py | Deploying to custom environments | LiveKit Docs