Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-12239

timeout / slow "view on board" link


      After looking at profiler data and source code it turned out that the DB access is very slow and not optimal.

      The first thing that I think is a problem is unnecessary DB access:
      35,6% - 22 274 ms com.atlassian.greenhopper.manager.rapidview.RapidViewManagerImpl.getAll

      public ServiceOutcome<List<RapidView>> getAll(final RapidViewPermissionCheck permissionCheck)
      final List<RapidView> result = new ArrayList<RapidView>();
      Consumer<RapidViewAO> cacheBuilder = new Consumer<RapidViewAO>()
      public void consume(RapidViewAO rapidViewAO)
      final Option<RapidView> rapidView = rapidViewCacheManager.get(rapidViewAO.getId());
      if (rapidView.isDefined() && permissionCheck.check(rapidView.get()))

      Unknown macro: { result.add(rapidView.get()); }

      return ok(result);

      we are loading all entries from rapidViewDao.loadAll(cacheBuilder)
      and then inside the cacheBuilder consumer we are doing rapidViewCacheManager.get(rapidViewAO.getId())
      which in case the record is not in cache reloads the record from DB (but we have loaded it from db a moment ago and obtained ID from it).
      Also for some reason when cache loads record from DB it does "com.atlassian.greenhopper.service.rapid.view.GenericActiveObjectsDao.load" but then "com.atlassian.greenhopper.service.rapid.view.RapidViewAOMapper.toModel" is doing access to the com.sun.proxy.$Proxy5044.isSprintsEnabled, com.sun.proxy.$Proxy5044.isSprintMarkersMigrated triggers another 2 access to the DB

      even though there are some annotations on ActiveObject that should preload the values from DB




      public interface RapidViewAO extends Entity

      The other "branch" in jprofiler that takes a lot of time is execition of
      "30,4% - 19 020 ms com.atlassian.greenhopper.service.rapid.RapidViewQueryServiceImpl.getScrumBoardQueryForVisibleIssues"
      Again the problem here is with active object loading from DB in slow manner.
      The com.atlassian.greenhopper.service.rapid.view.ColumnServiceImpl.ColumnCacheLoader loads data using
      com.atlassian.greenhopper.service.rapid.view.ColumnDao#getForParent(java.lang.Long) which result in massive DB traffic:

      15,6% - 6 893 ms - 4 062 hot spot inv. SELECT "ID","STATUS_ID","POS" FROM "AO_60DB71_COLUMNSTATUS" WHERE "COLUMN_ID" = ?

      the culprit is com.atlassian.greenhopper.service.rapid.view.ColumnAO#getStatuses which performs additional access to the DB for every column in every view.
      Maybe there is some option to preload this list in AO (some sql join maybe?) to avoid additional queries to the DB

            ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
            dchan David Chan
            0 Vote for this issue
            6 Start watching this issue