router - Akka ConsistentHashingRouter behavior not as expected -


i use consistenthashingrouter in order distribute data actor set of other actors. each message contains of a tuple (items: set[int], msg: string). wrote case class implements consistenthashable defining set of integers consistent hash key this.

case class message(items: set[int], msg: string) extends consistenthashable {    def consistenthashkey = items } 

now when let producer actor send lots of messages router, router distributes them quite unevenly target nodes.

i tried different number of target actors. in cases actor messages received got more double amount of messages actor least messages received.

when using hashing, expect messages distributed evenly amongst targets or missing here?

consistenthashkey returns object used calculate hash key (if don't return string or byte array apply murmurhash serialized bytes of object). don't know how equidistributed that, should @ "items" values encounter -- might quite biased.

also, consistent hashing not distribute totally evenly. see: http://en.wikipedia.org/wiki/consistent_hashing

in short, interval of hash keys wrapped form ring, , ring subdivided random points (hash of nodes) intervals (buckets). these buckets can end in non-equal sizes. more nodes have more "equal" -- not guaranteed.


Comments