Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-17672

Spark 2.0 history server web Ui takes too long for a single application

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1
    • Web UI
    • None

    Description

      When there are 10K application history in the history server back end, it can take a very long time to even get a single application history page. After some investigation, I found the root cause was the following piece of code:

      OneApplicationResource.scala
      @Produces(Array(MediaType.APPLICATION_JSON))
      private[v1] class OneApplicationResource(uiRoot: UIRoot) {
      
        @GET
        def getApp(@PathParam("appId") appId: String): ApplicationInfo = {
          val apps = uiRoot.getApplicationInfoList.find { _.id == appId }
          apps.getOrElse(throw new NotFoundException("unknown app: " + appId))
        }
      
      }
      

      Although all application history infos are stored in a LinkedHashMap, here to code transforms the map to an iterator and then uses the find() api which is O( n) instead of O(1) from a map.get() operation.

      Attachments

        Activity

          People

            wgtmac Gang Wu
            wgtmac Gang Wu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: