millions actors => stateful actors?

150 views
Skip to first unread message

Sukant Hajra

unread,
Jul 3, 2012, 10:10:01 PM7/3/12
to akka...@googlegroups.com
I just wanted to sanity check an assumption I've been making. Akka has done
some really nice work to keep actors lightweight to the point that it's
possible to fit millions of actors in memory.

But I can't come up with a reason to motivate millions of actors unless they
have state. Am I correct in this assumption?

So let's say I have these stateful actors. I feel as though "let it fail"
doesn't really apply to a JVM that's hit an OutOfMemoryError; I'd feel very
uncomfortable trying to handle that kind of error (I'm not even sure it's
possible in a trustworthy way). But this is what I feel will happen if too
many actors are spun up, right?

I can imagine maintaining counts of actors within the cascade of supervisor
actors to limit actor creation past a certain point. Is there a better
solution? Does Akka have API calls for managing this problem directly?

This inquiry is mostly out of curiosity. To date, I don't believe I have
stateful actors, so I don't think I'll need too many actors in my system. But
I'm still excited about the opportunities for throughput, failure recovery, and
hopefully some conveniences with development, configuration, and deployment.

Hopefully my intuition is right above; I'm mostly just looking for a sanity
check.

Thanks,
Sukant

Jonas Bonér

unread,
Jul 4, 2012, 8:29:43 AM7/4/12
to akka...@googlegroups.com
Absolutely. I agree. That many actors only makes sense if they are stateful.

You could use 3-5000 stateless actors if you use a lot of blocking
calls, but more would not help since that is roughly the limit of
threads on a JVM.
> --
> You received this message because you are subscribed to the Google Groups "Akka User List" group.
> To post to this group, send email to akka...@googlegroups.com.
> To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.
>



--
Jonas Bonér
Phone: +46 733 777 123
Home: http://jonasboner.com
Twitter: @jboner
Reply all
Reply to author
Forward
0 new messages