Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-84843

Performance issue when restoring questions on pgsql database.

XMLWordPrintable

    • MOODLE_500_STABLE

      Steps to reproduce, using moodle-docker and the attached benchmark_test.php script

      1. Run command:

          export MOODLE_DOCKER_WWWROOT=[Your moodle code]
          export MOODLE_DOCKER_PHP_VERSION=8.3
          export MOODLE_DOCKER_DB=mysql 
      

      2. Checkout to main branch.
      3. Copy benchmark_test.php to mod/quiz/tests/benchmark_test.php.
      4. Run commands:

          bin/moodle-docker-compose up -d
          bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php
          bin/moodle-docker-compose exec webserver vendor/bin/phpunit mod/quiz/tests/benchmark_test.php 
      

      5. Note the "Restore time" values

      • Expected: The times will be somewhere between 5 and 10 seconds.

      6. Run the test command 2 more times: bin/moodle-docker-compose exec webserver vendor/bin/phpunit mod/quiz/tests/benchmark_test.php

      • Expected: The times will be similar each run.

      7. Run bin/moodle-docker-compose down to make sure we clear everything such as cache.
      8. Run commands:

          export MOODLE_DOCKER_DB=pgsql
          bin/moodle-docker-compose up -d
          bin/moodle-docker-compose exec webserver php admin/tool/phpunit/cli/init.php
          bin/moodle-docker-compose exec webserver vendor/bin/phpunit mod/quiz/tests/
      

      9. Note the "Restore time" values

      • Expected: The times are similar to the first run

      10. Run the test command 2 more times: bin/moodle-docker-compose exec webserver vendor/bin/phpunit mod/quiz/tests/benchmark_test.php

      • Expected: The times will be similar each run.
      • Actual: Test tests take much longer, around 5 minutes each.

        1. benchmark_test_stable.php
          7 kB
          Mark Johnson
        2. benchmark_test.php
          7 kB
          Mark Johnson

            Unassigned Unassigned
            marxjohnson Mark Johnson
            Votes:
            10 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.