Ray: Resource request cannot be scheduled — how to check CPU usage or actor resource allocation

To check which resources (CPUs, actors, etc.) are currently being scheduled or used in Ray, you can use the ray.available_resources() and ray.nodes() functions in your Python code. These will show you the current logical resource usage and availability, helping you identify if all CPUs are claimed by actors or tasks. This is especially useful when you see scheduling warnings like “resource request cannot be scheduled right now” due to resource exhaustion. For more details, see the discussion at Too many actors cause worker is done.

Additionally, the Ray Dashboard (if available) provides a visual overview of resource usage, active actors, and pending tasks, which can help you debug resource bottlenecks. On Colab, you may not have access to the dashboard, so using the Python API is the best approach. If you want to see which actors are running, you can also use ray.util.state.list_actors() for more detailed actor state information. For more debugging tips, see Debugging Ray Data auto-scaling errors.

Would you like more detail on how to interpret these outputs or how to adjust your configuration to avoid resource deadlocks?

Sources:

Hint: Mention @RunLLM in the post for followups.