# Actor placement and execution resources

**URL:** <https://discuss.ray.io/t/actor-placement-and-execution-resources/12897>\
**Category:** Ray Core\
**Created:** [November 21, 2023, 11:10am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897 "2023-11-21T11:10:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [November 21, 2023, 11:10am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/1 "2023-11-21T11:10:49Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- None: Just asking a question out of curiosity

Hi there.

I just read the document about Ray architecture ([link](https://docs.google.com/document/d/1tBw9A4j62ruI5omIJbMxly-la5w4q_TjyJgJL_jN2fI/preview#heading=h.iyrm5j2gcdoq)), in particular, a paragraph of Resource Management and Scheduling, which say an Actor will request 0 CPU for execution by default but request 1 CPUs for placement. As far as I understand, when creating an actor Ray reserves 1 CPUs for the actor. When executing a method of the actor Ray has to use 1 CPUs for execution. I am confused a little. What does it mean “an Actor will request 0 CPU for execution”?

---

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [November 22, 2023, 10:22pm UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/2 "2023-11-22T22:22:29Z")

</div>

@sangcho, could you leave some light here?

---

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [November 27, 2023, 9:35am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/3 "2023-11-27T09:35:17Z")

</div>

@yic, could you leave a comment here?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [November 30, 2023, 1:06am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/4 "2023-11-30T01:06:46Z")

</div>

Hi, maybe the comment there is wrong. Basically, the current mechanism is as follow;

1. When actor is scheduled, it requires 1 CPU
2. Once actor is created, it requires 0 CPU.

So this ensures only up to num\_cpus actors can be created at the same time, but you can eventually have unlimited # of actors if you don’t specify num\_cpus. By schduling policy, actors are spread across the cluster by default

---

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [November 30, 2023, 10:06am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/5 "2023-11-30T10:06:06Z")

</div>

Hi @sangcho, thank you for your response. I am a little confused about your second point. Once actor is created, it requires 0 CPU. But neither a remote task nor another actor can’t be scheduled to the worker that already holds the actor created so I think it still requires 1 CPU. Isn’t it so?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [December 12, 2023, 4:00am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/6 "2023-12-12T04:00:19Z")

</div>

> But neither a remote task nor another actor can’t be scheduled to the worker that already holds the actor created

It is possible. I think the simple explanation is

1. You can schedule only upto num\_cpus=N actors at the same time.
2. Once actors are created, you can create infinite # of actors on that node.

---

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [December 12, 2023, 8:43am UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/7 "2023-12-12T08:43:17Z")

</div>

I mean that if a worker still holds an actor, we can’t schedule neither another actor nor a remote function to that worker. Is it right?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [December 12, 2023, 3:16pm UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/8 "2023-12-12T15:16:03Z")

</div>

when you say “worker”, did you mean worker process?

you cannot create a new actor to a worker process that already initiated an actor. But ray can have more than num\_cpus worker process (it is not a hard cap) per each node

---

<div class="post-metadata">

**Author:** ![YarShev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yarshev/32/638_2.png) [@YarShev](https://discuss.ray.io/u/YarShev)\
**Post date:** [December 12, 2023, 3:34pm UTC](https://discuss.ray.io/t/actor-placement-and-execution-resources/12897/9 "2023-12-12T15:34:16Z")

</div>

> when you say “worker”, did you mean worker process?

This is exactly what I mean.

> you cannot create a new actor to a worker process that already initiated an actor. But ray can have more than num\_cpus worker process (it is not a hard cap) per each node

Thanks, this makes sense to me.
