Actor spawning method

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

  • High: It blocks me to complete my task.

Hi!

I’m looking at ray and seems like it would be a great for something I’m playing with (mmo game server). I’ve tested several actor frameworks (akka, akka.net and proto.actor), but ray has the best DX so far, the only problem is that actors are way too expensive to spawn here due to how actors work (new process per actor).

Is it possible to change the actor “scheduler” (unsure if that’s how it’s called) to make several actors live in a single process? If not, how does this translate to ray in a way I can have several thousand of those actors running?

In other frameworks I’d spawn an actor per “object” in the world, like loot, monsters, npcs and players and several supervisor actors. Each object would manages it’s own “tick” rate to update it’s logic and mutate state through mailbox messages. This works fine since they really lightweight (can even spawn millions of them), but will OOM really fast with ray.

Also, regarding performance, how performant the communication and scheduling is within ray? I understand this is not an usual use case for ray, but I couldn’t find if it’s suitable for realtime simulations with a lot of message exchanges

Really hoping to hear thoughts from people with use cases similar to this one too (realtime/games/simulations).

Thanks

Ray doesn’t offer automatic “virtual actors”, but one way of reducing the overhead is to host multiple logical actors on Real ray actors. You would have to come up with some sharding of virtual actors to real actors, and could use AsyncIO to handle concurrency: AsyncIO / Concurrency for Actors — Ray 3.0.0.dev0

Regarding the performance, each actor call translates to a single gRPC call, so it should scale linearly with the number of actors involved. There are some microbenchmarks published here: ray/microbenchmark.json at master · ray-project/ray · GitHub

1 Like