-
Improvement
-
Resolution: Fixed
-
Minor
-
2.2.10, 2.3.7, 2.4, 2.5, 2.6
-
MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
get_users_by_capability_fix_master
-
In Moodle we have a database of about 40,000 users and our basic and interactions scorm reports span hundreds of pages.
We've encountered PHP memory exhaustion errors that we've traced to the get_users_by_capability calls in mod/scorm/report/<basic|interactions>/report.php
In order to fix the memory errors we had to set the PHP memory_limit > 512M from the default of 128M.
Our fix involves limiting the fields returned from get_users_by_capability to user ID and unsetting variables to decrease memory utilization. These are the performance numbers (with APC cache enabled) when running the scorm reports before and after the applied patch:
Pre-patch memory usage (peak MB): 616.4
Post-patch memory usage (peak MB): 97.1
After applying the patch we can use the PHP default memory limit of 128M.
Please take a look at the the following branches at http://github.com/timgus/moodle
get_users_by_capability_fix_m22
get_users_by_capability_fix_m23
get_users_by_capability_fix_m24
get_users_by_capability_fix_m25
get_users_by_capability_fix_master
- Discovered while testing
-
MDL-40512 undefined property when using SCORM
- Closed