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

Reduce db impact by consolidating queued events before writing to db

    XMLWordPrintable

    Details

    • Type: Task
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.5.0
    • Component/s: Sitestats
    • Labels:
      None

      Description

      In a simple test case (which is not necessarily realistic but a good illustration), if you request the same file 10 times from the same site (say within 10s) and have the db update interval set to 30s, sitestats does a number of db updates which could be consolidated.

      Each request generates db selects followed by updates to SST_EVENTS, SST_SITEACTIVITY and SST_RESOURCES.

      These could be optimized through consolidating identical events, e.g.

      SST_EVENTS: consolidate events for the same user, site, event and date (i.e. one update that increments count by 10 rather than 10 updates that increment count by 1).

      SST_SITEACTIVITY: consolidate events for the same site, event and date.

      In real-life usage, SST_SITEACTIVITY is most likely to benefit from this.

      It is also better for performance to put lots of writes (inserts or updates) into a single transaction than a set of separate transactions.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                nfernandes Nuno Fernandes (Inactive)
                Reporter:
                smarquard Stephen Marquard
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code