Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-1715 Yunikorn performance improvements
  3. YUNIKORN-1746

Improve the performance of nodeInfoListerImpl.List()

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None

    Description

      Performance data (cpu and heap profiles) indicate that we can improve the performance of nodeInfoListerImpl.List().

      This is the code which is located in the shim:

      func (n nodeInfoListerImpl) List() ([]*framework.NodeInfo, error) {
      	nodes := n.cache.GetNodesInfoMap()
      	nodeList := make([]*framework.NodeInfo, 0, len(nodes))
      	for _, node := range nodes {
      		nodeList = append(nodeList, node)
      	}
      
      	return nodeList, nil
      }
      

      We're supposed to be having a read lock on the cache, which is done outside this method.

      The problem is, the nodes info map only changes if a node joins or leaves the cluster. A lot of copying is done here, we generate a lot of waste. This method is called very frequently, because predicates need this list and predicates always run for each pod by default.

      Attachments

        1. screenshot-1.png
          135 kB
          Peter Bacsko
        2. screenshot-2.png
          210 kB
          Peter Bacsko

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: