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

saving course settings is suspiciously slow when you have lots of courses

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3
    • Fix Version/s: STABLE backlog
    • Component/s: Course
    • Labels:
    • Environment:
      Ubuntu 11.04
      MySql MySQL 5.1.54-1ubuntu4
      PHP 5.3.5-1ubuntu7.7 with Suhosin-Patch (cli) (built: Feb 11 2012 06:42:47)
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_23_STABLE

      Description

      I have 10029 courses in my database. If I go into the course I use for development and go into the course settings, change nothing and click "save changes" it takes a really really long time to save and for the page to reload. Something funny is going on.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            andyjdavis Andrew Davis added a comment -

            Total time ranges from around 30 seconds to so long that I gave up.

            Show
            andyjdavis Andrew Davis added a comment - Total time ranges from around 30 seconds to so long that I gave up.
            Hide
            salvetore Michael de Raadt added a comment -

            Ah, funny business.

            Have you tried this in earlier versions?

            Show
            salvetore Michael de Raadt added a comment - Ah, funny business. Have you tried this in earlier versions?
            Hide
            andyjdavis Andrew Davis added a comment -

            I haven't so far.

            Show
            andyjdavis Andrew Davis added a comment - I haven't so far.
            Hide
            andyjdavis Andrew Davis added a comment - - edited

            Turning up the priority on this because I keep running into it. Typically when I hit "save changes" on the course settings page the page just loads forever. Killing the browser and restarting apache doesnt seem to bring it back so I suspect that whatever is going on is tying up the database.

            update: not sure the above is accurate. Even after restarting the browser, apache and mysql I couldnt revive Moodle. A full reboot did the trick.

            Show
            andyjdavis Andrew Davis added a comment - - edited Turning up the priority on this because I keep running into it. Typically when I hit "save changes" on the course settings page the page just loads forever. Killing the browser and restarting apache doesnt seem to bring it back so I suspect that whatever is going on is tying up the database. update: not sure the above is accurate. Even after restarting the browser, apache and mysql I couldnt revive Moodle. A full reboot did the trick.
            Hide
            tonybutler Tony Butler added a comment -

            This affects Moodle 2.2.4 too.

            Show
            tonybutler Tony Butler added a comment - This affects Moodle 2.2.4 too.
            Hide
            tonybutler Tony Butler added a comment - - edited

            This was caused by the call to fix_course_sortorder in our case, and the workaround suggested at http://tracker.moodle.org/browse/MDL-31617 fixed it for us (i.e. simply adding an index on mdl_course.sortorder).

            Show
            tonybutler Tony Butler added a comment - - edited This was caused by the call to fix_course_sortorder in our case, and the workaround suggested at http://tracker.moodle.org/browse/MDL-31617 fixed it for us (i.e. simply adding an index on mdl_course.sortorder).
            Hide
            andyjdavis Andrew Davis added a comment -

            Im assigning this to myself. I keep running into this so seem a natural candidate to fix it.

            Show
            andyjdavis Andrew Davis added a comment - Im assigning this to myself. I keep running into this so seem a natural candidate to fix it.
            Hide
            andyjdavis Andrew Davis added a comment -

            Came across MDL-35665 while working on this.

            Show
            andyjdavis Andrew Davis added a comment - Came across MDL-35665 while working on this.
            Hide
            andyjdavis Andrew Davis added a comment -

            This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

            For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

            Show
            andyjdavis Andrew Davis added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment
            Hide
            dorianborg Dorian Borg added a comment - - edited

            removed double post by mistake

            Show
            dorianborg Dorian Borg added a comment - - edited removed double post by mistake
            Hide
            dorianborg Dorian Borg added a comment -

            we had the problem which was described above. Our moodle is running on 2.4.3 and has over 17K courses within a single category.

            To overcome this problem we changed the value of define('MAX_COURSES_IN_CATEGORY', 10000); to define('MAX_COURSES_IN_CATEGORY', 1000000);

            There is another setting define('MAX_COURSE_CATEGORIES', 10000); (max number of categories) which we have not amended.

            Note that MAX_COURSES_IN_CATEGORY and MAX_COURSE_CATEGORIES will be multiplied together and the result should not exceed 2147483647 ( max int value).

            We have also defined the setting in config.php so that when upgrading, we would not need to remember setting the value again.

            Do Moodle developers have some comments to make on my posts? ie it is this the correct way to overcome the problem?

            thank you
            Dorian

            Show
            dorianborg Dorian Borg added a comment - we had the problem which was described above. Our moodle is running on 2.4.3 and has over 17K courses within a single category. To overcome this problem we changed the value of define('MAX_COURSES_IN_CATEGORY', 10000); to define('MAX_COURSES_IN_CATEGORY', 1000000); There is another setting define('MAX_COURSE_CATEGORIES', 10000); (max number of categories) which we have not amended. Note that MAX_COURSES_IN_CATEGORY and MAX_COURSE_CATEGORIES will be multiplied together and the result should not exceed 2147483647 ( max int value). We have also defined the setting in config.php so that when upgrading, we would not need to remember setting the value again. Do Moodle developers have some comments to make on my posts? ie it is this the correct way to overcome the problem? thank you Dorian

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: