5-11-07 14:01:02,194 - WARNING livekit.agents - pr...
# ask-ai
a
2025-11-07 140102,194 - WARNING livekit.agents - process memory usage is high {"memory_usage_mb": 602.0, "memory_warn_mb": 500, "memory_limit_mb": 0, "pid": 89592, "job_id": "AJ_4VJC5ix2cvQr"} what should i do with this?
t
Thanks for reaching out, Jaihee. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
It looks like the warning is letting you know that a job process has gone over the memory warning threshold of 500 MB, but hasn’t hit a hard limit yet. This is actually a helpful safety feature to keep an eye on resource usage and avoid any instability. Here are a few friendly suggestions you might find useful: • Take a look at the memory usage of the job process (PID: 89592) to see if there’s any room for optimization. • You might want to consider increasing the memory warning threshold or setting a hard memory limit using the
WorkerOptions
class. For example, in Python:
Copy code
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.ts
a
I'm using livekit cloud what should i do?
t
In LiveKit Cloud, the "process memory usage is high" warning means that a job process has gone over the memory warning threshold (which is set to 500 MB by default). Don’t worry, here are some friendly steps you can take to address this: 1. Monitor Memory Usage: Take a look at how much memory the job process is using. This can help you spot areas where things might be optimized. 2. Adjust Memory Thresholds: If it feels right, you can tweak the
job_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.sh
a
what should i do in livekit settings?
t
In LiveKit Cloud, if you’re noticing high memory usage warnings, don’t worry — there are some straightforward ways to adjust your agent’s configuration to help manage this. Here’s a friendly guide to get you started: 1. Adjust Memory Thresholds: You can tweak the
job_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:
Copy code
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.sh
a
how can i do 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.
t
Great question! In LiveKit Cloud, resource scaling is completely automated, so you don’t have to worry about manually setting CPU or memory for workers. LiveKit Cloud takes care of managing capacity by scaling agent instances based on demand and smartly optimizing infrastructure placement for CPU, memory, and network conditions. If you’re self-hosting or using a custom Kubernetes setup, a good starting point is to configure 4 CPU cores and 8 GB RAM per worker. You can easily do this through the Helm chart values under the
resources
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.yaml
a
worker_options = WorkerOptions( job_memory_warn_mb=700, job_memory_limit_mb=1024, # ... other options ) what is recommended value
t
Here are some recommended values for
job_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