[Akka 2.1.4] ConsistentHash router and memory issues

52 views
Skip to first unread message

gutzeit

unread,
Aug 10, 2015, 6:44:03 AM8/10/15
to Akka User List
Hey,

I am using akka 2.1.4 (yeah, old, tell me about it) and lately been experimenting with ConsistentHashing routers.

I have two routers defined like that with, 

            /blahRouter {

                router = consistent-hashing

                nr-of-instances = 100000

                virtual-nodes-factor = 10

            }

            /blah1Router {

                router = consistent-hashing

                nr-of-instances = 100000

                virtual-nodes-factor = 10

            }



After running for a while, I do jmap to see the living objects, and to my surprise i see the following:

             instances          size
 10:      31600064     1011202048  akka.routing.ConsistentActorRef


The question is, how come there are so many those internal classes retained for at most of 200K actors ?

Am I missing anything ?

Akka Team

unread,
Aug 13, 2015, 2:38:08 AM8/13/15
to Akka User List
Hi Dima,

as far as I can see the implementation is quite wasteful in creating these ConsistentActorRef wrappers (100K for every message send in your case). 2.3.12 should be much smarter in this regard …

Regards,

Roland

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam

Dima Gutzeit

unread,
Aug 13, 2015, 4:55:37 AM8/13/15
to akka...@googlegroups.com, Akka User List
OMG. I better stop using ConsistentHashing routing then. Bummer.

Regards,
Dima Gutzeit


You received this message because you are subscribed to a topic in the Google Groups "Akka User List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/Y65Zc8_ke7s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to akka-user+...@googlegroups.com.

Roland Kuhn

unread,
Aug 15, 2015, 4:01:01 AM8/15/15
to akka-user
… or stop using ancient versions of Akka ;-)


Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


Dima Gutzeit

unread,
Aug 15, 2015, 11:58:14 AM8/15/15
to akka-user
Lots of systems tied up on the Akka 2.1 binary protocol, not easy to migrate.

If I want to port the 2.3 implementation of ConsistentRouter to 2.1, you think it's something easy to do, or everything was changed completely ?

Regards,
Dima Gutzeit

Konrad Malawski

unread,
Aug 17, 2015, 10:10:59 AM8/17/15
to Akka User List
It may be possible to backport the ConsistentRouter, you can give it a shot, however it would have to be in your codebase as 2.1 has been EndOfLife-ed some time ago, we don't maintain it anymore.
For a number of other reasons (stability and perf improvements) I'd highly recommend putting an update to "latest version" note to your planning though.
As for binary compat - are you not controlling the nodes in your cluster that you say you're stuck?


--
Cheers,
Konrad 'ktoso' Malawski
Reply all
Reply to author
Forward
0 new messages