Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-44003

Performance regression: simple actions load all site groups

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 20.1
    • Component/s: None
    • Labels:
      None
    • 20 status:
      Resolved
    • 19 status:
      Won't Fix
    • Test Plan:
      Hide

      Enable debug query logging for authz service. Look at catalina.out logs for the number of times lines like this show up:

      DbAuthzGroupService: found /site/79a1bcaf-9431-4036-bcde-99b94b3986a5/group/00259f27-520f-44a3-b13e-fc6afefd4386 in cache? false

      when a site is accessed.

      Enable the mysql general query log and look at the volume of authz queries generated for simple actions in sites with a lot of groups.

      Show
      Enable debug query logging for authz service. Look at catalina.out logs for the number of times lines like this show up: DbAuthzGroupService: found /site/79a1bcaf-9431-4036-bcde-99b94b3986a5/group/00259f27-520f-44a3-b13e-fc6afefd4386 in cache? false when a site is accessed. Enable the mysql general query log and look at the volume of authz queries generated for simple actions in sites with a lot of groups.

      Description

      SAK-41172 introduced changes for group locking which have had the side-effect that caching a site will read all group realms for the site. Caching a site can be triggered by any type of site access.

      SItes with a large number of groups (for example we have one site with > 600 groups) will cause at least N*2 queries (N=groups) for this.

      The call stack is visible here with some additional logging introduced into DbAuthzGroupService to log the stack at the point where completeGet() is called.

      The relevant change appears to be here:

      https://github.com/sakaiproject/sakai/commit/0b9d28b85062a7d6358c57bd0accedcdf9904a8b#diff-d91e62ae6b98cbb63801c2028c2494c0R138

      2020-07-26 19:55:42,846 DEBUG ajp-nio-0.0.0.0-8009-exec-9 org.sakaiproject.authz.impl.DbAuthzGroupService - DbAuthzGroupService: found /site/79a1bcaf-9431-4036-bcde-99b94b3986a5/group/00259f27-520f-44a3-b13e-fc6afefd4386 in cache? false
      2020-07-26 19:55:42,846 DEBUG ajp-nio-0.0.0.0-8009-exec-9 org.sakaiproject.authz.impl.DbAuthzGroupService - Called here for /site/79a1bcaf-9431-4036-bcde-99b94b3986a5/group/00259f27-520f-44a3-b13e-fc6afefd4386
      java.lang.Throwable
      at org.sakaiproject.authz.impl.DbAuthzGroupService$DbStorage.completeGet(DbAuthzGroupService.java:832)
      at org.sakaiproject.authz.impl.DbAuthzGroupService$DbStorage.get(DbAuthzGroupService.java:780)
      at org.sakaiproject.authz.impl.DbAuthzGroupService$DbStorage.get(DbAuthzGroupService.java:772)
      at org.sakaiproject.authz.impl.BaseAuthzGroupService.getAuthzGroup(BaseAuthzGroupService.java:406)
      at org.sakaiproject.site.impl.BaseGroup.getAzg(BaseGroup.java:330)
      at org.sakaiproject.site.impl.BaseGroup.getRealmLocks(BaseGroup.java:658)
      at org.sakaiproject.site.impl.BaseGroup.<init>(BaseGroup.java:138)
      at org.sakaiproject.site.impl.BaseSite.set(BaseSite.java:708)
      at org.sakaiproject.site.impl.BaseSite.<init>(BaseSite.java:253)
      at org.sakaiproject.site.impl.BaseSiteService.cacheSite(BaseSiteService.java:644)
      at org.sakaiproject.site.impl.BaseSiteService.getDefinedSite(BaseSiteService.java:687)
      at org.sakaiproject.site.impl.BaseSiteService.getSite(BaseSiteService.java:756)
      at org.sakaiproject.site.impl.BaseSiteService.getSiteVisit(BaseSiteService.java:834)
      at org.sakaiproject.site.cover.SiteService.getSiteVisit(SiteService.java:158)
      at org.sakaiproject.portal.charon.handlers.PresenceHandler.doPresence(PresenceHandler.java:93)
      at org.sakaiproject.portal.charon.handlers.PresenceHandler.doGet(PresenceHandler.java:69)

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  smarquard Stephen Marquard
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  12 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration