Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-16082

Cleanup jobs have insufficient performance on MySql

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 5.10.0, 5.9.8
    • 5.7.2, 5.8.1, 5.9.7
    • Performance
    • None

    Description

      Both the build expiry and the "Orphaned Result Deletion Job" (a scheduled job
      that runs every 120 seconds) perform very poorly on our large MySql Database. We have identified the culprit queries and managed to optimize those for mysql (See patch: speed_up_build_expiry_mysql.patch).

      Without the patch, queries like this one:

      delete from VARIABLE_SUBSTITUTION where BUILDRESULTSUMMARY_ID in (
             select BUILDRESULTSUMMARY_ID from BUILDRESULTSUMMARY
             where BUILDRESULTSUMMARY.BUILD_KEY = "BAM-1");

      run over 120 Seconds, as they do a full table scan on VARIABLE_SUBSTITUTION
      (which is really large). To make things worse, the query locks
      BUILTRESULTSUMMARY, so that queries that try to write to it run into the lock
      timeout. With some optimizations to the database (anything that is suggested
      here, and more), we were able to mitigate this a bit, but the issue still persists.

      The patch uses MySql specific "delete from join" syntax, but only if the database is MySql. Using this, the equivalent delete queries execute in under a second (as they are able to use the indices).

      Also see this question I asked on dba.stackexchange.com.

      Attachments

        Issue Links

          Activity

            People

              kbrazulewicz Krystian Brazulewicz
              3bea9b9e5330 Martin Sander
              Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: