agents
agents copied to clipboard
Incorrect CPU usage detection on shared hosts
The worker currently monitors CPU usage and shuts down if the usage exceeds a certain threshold. It determines CPU usage using the function psutil.cpu_percent(0.5)
, as shown here: livekit worker code. This method works well on dedicated hosts, but on shared hosts (e.g., Render.com), it returns the CPU usage of the entire base system rather than the specific instance container. If the base system is shared among multiple containers and is under heavy load, the worker may incorrectly interpret this as high CPU usage for its instance, leading to unnecessary shutdowns.