agents icon indicating copy to clipboard operation
agents copied to clipboard

Incorrect CPU usage detection on shared hosts

Open quang-purplefish opened this issue 4 months ago • 1 comments

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.

quang-purplefish avatar Oct 22 '24 01:10 quang-purplefish