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

Performance problem on "view/grade all submissions" when groups enabled

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      PHPUnit

      1. Run PHPUnit tests for mod/assign/tests/locallib_test.php. Confirm that there are no failures.

      Manual testing

      1. Create a course with 1000 students enrolled.
        • If developer mode is on, you can create a test course with 1000 students by going to Site administration ▶ Development ▶ Make test course and select "M (~100MB; create in ~5 minutes)" and enter the necessary information and click "Create course"
      2. Separate students into 100 groups.
        • Go to the previously created course. Under Course administration, click Users ▶ Groups then select "Auto-create groups". Make sure that "Auto create based on" is set to "Number of groups" and enter 100 for "Group/member count", then click Submit.
      3. Login as a user (i.e. a Teacher) with the following capabilities:
        • moodle/site:accessallgroups
        • mod/assign:editothersubmission (You might need to manually set this capability to "Allow" beforehand in Site administration ▶ Users ▶ Permissions ▶ Define roles, or just login as Admin)
      4. Create an Assignment activity. If you chose to create a test course, select any of the generated assignments.
      5. Under the selected assignment's "Common module settings", set the "Group mode" to "Separate groups" then click "Save and display".
      6. Under Grading summary, click "View/grade all submissions".
      7. Set the "Assignments per page" option to 100
      8. Measure the average page load times by reloading the page at least 3 times.
        • You might want to use the browser's tools like Chrome DevTools' Network panel, etc.
        • Aside from the whole page load time, you can also check the load times of the mod/assign/view.php document in the network panel.
      9. Apply the patch.
      10. Measure the average page load times again.
      11. Confirm that
      • The page load time is 30-60% less than before the patch.
      • There are no missing students in the grading list.
      Show
      PHPUnit Run PHPUnit tests for mod/assign/tests/locallib_test.php. Confirm that there are no failures. Manual testing Create a course with 1000 students enrolled. If developer mode is on, you can create a test course with 1000 students by going to Site administration ▶ Development ▶ Make test course and select "M (~100MB; create in ~5 minutes)" and enter the necessary information and click "Create course" Separate students into 100 groups. Go to the previously created course. Under Course administration, click Users ▶ Groups then select "Auto-create groups". Make sure that "Auto create based on" is set to "Number of groups" and enter 100 for "Group/member count", then click Submit. Login as a user (i.e. a Teacher) with the following capabilities: moodle/site:accessallgroups mod/assign:editothersubmission (You might need to manually set this capability to "Allow" beforehand in Site administration ▶ Users ▶ Permissions ▶ Define roles, or just login as Admin) Create an Assignment activity. If you chose to create a test course, select any of the generated assignments. Under the selected assignment's "Common module settings", set the "Group mode" to "Separate groups" then click "Save and display". Under Grading summary, click "View/grade all submissions". Set the "Assignments per page" option to 100 Measure the average page load times by reloading the page at least 3 times. You might want to use the browser's tools like Chrome DevTools' Network panel, etc. Aside from the whole page load time, you can also check the load times of the mod/assign/view.php document in the network panel. Apply the patch. Measure the average page load times again. Confirm that The page load time is 30-60% less than before the patch. There are no missing students in the grading list.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51314-groupmembership

      Description

      There is currently a performance problem with the "view submitted assignments" page when groups are enabled. Currently there is a response rate anywhere from 10/20 seconds in a course with 300 users listing only 50 as the default. When testing the same course/content in our old moodle 2.4 the page loads are about 3/5 seconds. I am suspecting that this is happening due to the "has_capability" function and the two previous calls listed in the calligraph.

      I have attached the xhprof as well as some analytics stats which show the very slow page load, which seem to be limited to this atm.

      Full setps to reproduce

      • Enrol 500 users into a course
      • Enable groups for course
      • View /assign/view.php?id=111111&action=grading page as course editor
        Expectations : I expect this page to load in < 3/5secs
        Actual : 8/10++ seconds

      Our current version : 2.7.3+ (Build: 20141120)

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jan/16