Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1715

Yunikorn performance improvements

    XMLWordPrintableJSON

Details

    Description

      There are some methods/functions in Yunikorn which are called frequently and often unnecessarily. On a large, busy cluster, eliminating these calls can result in faster scheduling cycle, therefore better throughput.

      In the listed cases below, we can re-use a previously computed value and the expensive copy/sort phase can be eliminated completely.

      Retrieving node iterators: in baseNodeCollection.getNodeIteratorInternal(), we always clone the tree of sorted nodes, then we build a slice. The node tree is only modified when a node gets a new score (plus node add/removal). By reusing the sorted list, we avoid cloning an *btree.BTree structure and creating []*Node slices.

      Queue sorting: only need sorting if the following occurred:

      • Allocated resource changed in one of the child queues (most common)
      • Pending resource changed from 0 to "n", or from "n" to 0 (affects filtering)
      • Child queue got stopped (affects filtering)
      • Child queue structure changed on config update

      Application sorting: in Queue.TryAllocate() and Queue.TryPlaceholderAllocate(), sortApplications() always runs. In every iteration, it calls Queue.GetCopyOfApps() then proceeds to sort the apps. It only has to run if something relevant happens from the sorting POV:

      • Application added/removed
      • Ask added to an application
      • Ask max priority changed in at least one application
      • Allocated resource changed in at least one application

      Request sorting: request (ask) sorting is only necessary when the following occurs:

      • Ask added
      • pendingAskRepeat gets 0 in an ask

      Misc: we can have a bunch of other stuff that helps performance.

      Attachments

        1.
        Improve the performance of baseNodeCollection.getNodeIteratorInternal() Sub-task Closed Peter Bacsko
        2.
        Improve the performance of Queue.sortQueues() Sub-task Closed Unassigned
        3.
        Improve the performance of Queue.sortApplications() Sub-task Closed Peter Bacsko
        4.
        Improve the performance of Application.sortRequests() Sub-task Closed Peter Bacsko
        5.
        Improve the performance of node.preAllocateCheck() Sub-task Closed Eli Schiff
        6.
        Re-think the usage of *resource.Resource objects Sub-task Closed Unassigned
        7.
        Remove string comparison from hasReadyCondition() function Sub-task Closed Peter Bacsko
        8.
        Improve the performance of shim side scheduling cycle Sub-task Closed Peter Bacsko
        9.
        Add predicate with equivalence cache to improve the scheduler performance Sub-task Closed Qi Zhu
        10.
        Improve the performance of nodeInfoListerImpl.List() Sub-task Closed Peter Bacsko
        11.
        Improve the performance of HavePodsWithAffinityList() and HavePodsWithRequiredAntiAffinityList() Sub-task Closed Peter Bacsko
        12.
        Don't copy resource object in Node.preAllocateCheck() Sub-task Closed Peter Bacsko
        13.
        Avoid resource clone in Application.tryNodes() Sub-task Closed Peter Bacsko
        14.
        Application: maintain sorted state of requests instead of sorting Sub-task Closed Peter Bacsko
        15.
        Store time in int64 type instead of time.Time Sub-task Closed Peter Bacsko
        16.
        Re-use predicate results for reservation Sub-task Closed Peter Bacsko
        17.
        Move prefilter plugins out of node predicates to improve performance Sub-task Closed Qi Zhu
        18.
        Improve the performance of tryPlaceholderAllocate Sub-task Closed Peter Bacsko
        19.
        Further performance improvements on HavePodsWithAffinityList() and HavePodsWithRequiredAntiAffinityList() Sub-task Closed Peter Bacsko
        20.
        Optimize scheduling cycle if there's no placeholder allocation or reservation Sub-task Closed Peter Bacsko

        Activity

          People

            pbacsko Peter Bacsko
            pbacsko Peter Bacsko
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: