# Understanding resource requirement for tasks and actors

**URL:** <https://discuss.ray.io/t/understanding-resource-requirement-for-tasks-and-actors/11416>\
**Category:** Ray Core\
**Created:** [July 14, 2023, 4:20pm UTC](https://discuss.ray.io/t/understanding-resource-requirement-for-tasks-and-actors/11416 "2023-07-14T16:20:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Y\_C](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/y_c/32/4142_2.png) [@Y\_C](https://discuss.ray.io/u/Y_C)\
**Post date:** [July 14, 2023, 4:20pm UTC](https://discuss.ray.io/t/understanding-resource-requirement-for-tasks-and-actors/11416/1 "2023-07-14T16:20:47Z")

</div>

From the documentation [Resources — Ray 2.5.1](https://docs.ray.io/en/latest/ray-core/scheduling/resources.html#resource-requirements),

```auto
by default, actors cannot get scheduled on a zero-cpu node, but an infinite number of them can run on any non-zero cpu node. 

```

Can you elaborate it? Why would an actor be running on a node if it cannot be scheduled on it?

And I’m setting the head node to have zero cpu as suggested in the cluster config: [RayCluster Configuration — Ray 2.5.1](https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/config.html#num-cpus)  
Does it mean that the head node is only used to run the driver code but not the actual task, i.e. the function/class decorated by remote?

---

<div class="post-metadata">

**Author:** ![jjyao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jjyao/32/1799_2.png) [@jjyao](https://discuss.ray.io/u/jjyao)\
**Post date:** [July 17, 2023, 6:13am UTC](https://discuss.ray.io/t/understanding-resource-requirement-for-tasks-and-actors/11416/2 "2023-07-17T06:13:16Z")

</div>

Yea, if you set head node to zero cpu then the head node can only run driver code or any task/actors with explicit `num_cpus=0`.

For the actor resource, I’d suggest you to explicit set num\_cpus instead of relying on the default behavior which only exists for historical reasons.
