Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2067

The ConsistentHash implementation on the hotrod client is very inefficient

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.1.4.FINAL
    • Fix Version/s: 5.1.5.FINAL
    • Component/s: None
    • Labels:
      None

      Description

      Profiler snapshots show that a large amount of time is spent in the org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashV1#getServer method (about 13%).
      The root cause of this is the fact that the size method invoked on an object returned by TreeMap.tail() is very expensive: TreeMap.tail() returns an instance of TreeMap.AscendingSubMap class for which the size method, in order to calculates the number of elements, iterates over the entire collection(O). This is highly inefficient and not scalable especially since the number of virtual nodes was set to 50 by default, as not the size of the collection is quite high: e.g. 32 nodes with 50 virtual nodes each, size()'s iterates an average of ~750 elements.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mircea.markus Mircea Markus
                Reporter:
                mircea.markus Mircea Markus
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: