Uploaded image for project: 'mod_cluster'
  1. mod_cluster
  2. MODCLUSTER-757

internal_find_best_byrequests scales inefficiently with balancer members

    XMLWordPrintable

Details

    Description

      internal_find_best_byrequests scales inefficiently with balancer members currently. This is from repeating find_node_context_host (it loops per JVM count in this method) from context_host_ok calls that were looped over in internal_find_best_byrequests by the JVM count, making this an O(n^2) operation where n is the JVM count. This can heavily degrade performance of any requests that aren't stickied.

      With 500 members, I can see it approaching 80 ms just for this portion of the request with a single user load (and this scales even worse as load increases):

      [Tue Jul 05 14:49:18.114559 2022] [:debug] [pid 507115:tid 139847549314816] mod_proxy_cluster.c(3184): proxy_cluster_pre_request begin
      [Tue Jul 05 14:49:18.181707 2022] [:debug] [pid 507115:tid 139847549314816] mod_proxy_cluster.c(1963): proxy: byrequests balancer DONE (ajp://127.0.0.1:9000)
      

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-jclere Jean-Frederic Clere
              rhn-support-aogburn Aaron Ogburn
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: