import ray
ray.init(num_cpus=2)
@ray.remote
class Foo:
pass
actor_list = [Foo.remote for _ in range(2)]
@ray.remote
def foo():
return 1
o_ref = foo.remote()
We have two available workers. When creating actors they are places onto those two available workers. My question is that when foo gets submitted, does Ray create a new worker process and then kills it after foo completes in it?
On a very high level, Ray maintains a worker pool and will create new worker processes as needed to execute the task, and applies a timeout to reap idle processes.