New Moodle Slow saving grade changes

New Moodle Slow saving grade changes

by Jason Touw -
Number of replies: 23

We have just started our own Windows 2012 server running Moodle v3.0.

We imported courses from another server running v2.8.

It makes no difference....Grades Single View, Grader Report, whatever.  When I click save changes, Moodle gets very slow or hangs up.

Any suggestions?

Thank you!!!

Average of ratings: -
In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

With no background information, I'm not sure how you expect anybody to answer this wink

Can we get the specification of your server? What have you done (if anything) to investigate the issue? How is your Moodle (MUC) caching set up (if you don't know what I am talking about or haven't touched it - tell is about the disk your 'moodledata' is sitting on - is it fast enough?)?

Average of ratings: Useful (1)
In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Hi Howard,

I welcome your willingness to help (and deal with) my attempts at learning to be a site Admin for our new server.  I am actually really good with Moodle and it's functionality, I am new to maintaining a database server.

We are running Moodle 3.0 on a Windows 2012R2 server.  We have an intel Xeon 2.67 Ghz Processor, 10 GB RAM.  We have Microsoft Server Manager installed.

Apache, MySQL and IIS is installed on the Server as that came bundled with the Moodle Install.

As far as caching, I haven't touched it and I don't know how to check those settings....I do also notice that Moodle takes A LONG TIME when I Duplicate an assignment, label, quiz, etc.


Thank you Thank you Thank you...Many thanks to anyone in the community that can help our School District get things configured properly and running smoothly.


In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Where is $CFG->dataroot ('moodledata') pointing to? Is that a physical local disk or is it some sort of shared or network attached storage. Worse, is this a VM of some sort? 

Without changing anything, Moodle requires fast local storage to support its caches. Slow disk (common in NAS and VM environments) can have a severe impact on page load times. It's worth eliminating anyway. 

When you say that apache et. al. came bundled - does this mean you are using an xampp based install (the one-click installer downloaded from moodle.org for example). If so, that is unsuitable for a 'production' install... it's just for testing/evaluation. 

In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Backup just a moment.  I am not fluent with the server stuff but I am a techy person and learn quickly.  

On a Windows Server (or in Moodle) where do I access $CFG->dataroot to answer your inquiry?  

I am not certain how this machine was set up with the caching.  How would I check?


Thank you Howard!

In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -
Below are the cache settings that I pulled from Moodle:


Cache administration

Installed cache stores

PluginReadyStoresModesSupportsActions
File cache11Application, Sessiondata guarantee, ttl, key awarenessAdd instance
Memcache0Applicationttl
Memcached0Applicationttl
MongoDB0Applicationdata guarantee
Session cache11Sessiondata guarantee, ttl, key awareness
Static request cache11Requestdata guarantee, ttl, key awareness

Configured store instances

Store namePluginReadyStore mappingsModesSupportsLockingHelp with LockingActions
Default file store for application cachesFile cache10Application, Sessiondata guarantee, ttl, key awareness, searching by keyDefault file lockingDefault stores cannot be modifiedPurge
Default static store for request cachesStatic request cache10Requestdata guarantee, ttl, key awareness, searching by keyDefault file lockingDefault stores cannot be modifiedPurge
Default session store for session cachesSession cache10Sessiondata guarantee, ttl, key awareness, searching by keyDefault file lockingDefault stores cannot be modifiedPurge

Known cache definitions

DefinitionModeComponentAreaStore mappingsActions
Accumulated information about modules and sections for each courseApplicationcorecoursemodinfoDefault file store for application cachesEdit mappings,Edit sharing,Purge
Activity completion statusApplicationcorecompletionDefault file store for application cachesEdit mappings,Edit sharing,Purge
Calendar subscriptionsApplicationcorecalendar_subscriptionsDefault file store for application cachesEdit mappings,Edit sharing,Purge
Concept linkingApplicationmod_glossaryconceptsDefault file store for application cachesEdit mappings,Edit sharing,Purge
Config settingsApplicationcoreconfigDefault file store for application cachesEdit mappings,Edit sharing,Purge
Course categories lists for particular userSessioncorecoursecatDefault session store for session cachesEdit mappings,Purge
Course categories recordsRequestcorecoursecatrecordsDefault static store for request cachesEdit mappings,Purge
Course categories treeApplicationcorecoursecattreeDefault file store for application cachesEdit mappings,Edit sharing,Purge
Course group informationApplicationcoregroupdataDefault file store for application cachesEdit mappings,Edit sharing,Purge
Data used to persist user selections throughout MoodleSessioncoreuserselectionsDefault session store for session cachesEdit mappings,Purge
Database meta informationApplicationcoredatabasemetaDefault file store for application cachesEdit mappings,Edit sharing,Purge
Event invalidationApplicationcoreeventinvalidationDefault file store for application cachesEdit mappings,Edit sharing,Purge
Event observersApplicationcoreobserversDefault file store for application cachesEdit mappings,Edit sharing,Purge
External badges for particular userApplicationcoreexternalbadgesDefault file store for application cachesEdit mappings,Edit sharing,Purge
Folder name cacheSessionrepository_skydrivefoldernameDefault session store for session cachesEdit mappings,Purge
Grade items cached for evaluating conditional availabilityApplicationavailability_gradeitemsDefault file store for application cachesEdit mappings,Edit sharing,Purge
Helper cachingRequesttool_uploadcoursehelperDefault static store for request cachesEdit mappings,Purge
HTML Purifier - cleaned contentApplicationcorehtmlpurifierDefault file store for application cachesEdit mappings,Edit sharing,Purge
Language string cacheApplicationcorestringDefault file store for application cachesEdit mappings,Edit sharing,Purge
List of available languagesApplicationcorelangmenuDefault file store for application cachesEdit mappings,Edit sharing,Purge
List of course contactsApplicationcorecoursecontactsDefault file store for application cachesEdit mappings,Edit sharing,Purge
List of suspended users per courseRequestcoresuspended_useridsDefault static store for request cachesEdit mappings,Purge
Navigation expandable coursesSessioncorenavigation_expandcourseDefault session store for session cachesEdit mappings,Purge
Plugin info managerApplicationcoreplugin_managerDefault file store for application cachesEdit mappings,Edit sharing,Purge
Plugins available callbacksApplicationcoreplugin_functionsDefault file store for application cachesEdit mappings,Edit sharing,Purge
Question definitionsApplicationcorequestiondataDefault file store for application cachesEdit mappings,Edit sharing,Purge
Repositories instances dataRequestcorerepositoriesDefault static store for request cachesEdit mappings,Purge
System capabilities listApplicationcorecapabilitiesDefault file store for application cachesEdit mappings,Edit sharing,Purge
This stores the list of event subscriptions for individual coursesApplicationtool_monitoreventsubscriptionsDefault file store for application cachesEdit mappings,Edit sharing,Purge
User grades cached for evaluating conditional availabilityApplicationavailability_gradescoresDefault file store for application cachesEdit mappings,Edit sharing,Purge
YUI Module definitionsApplicationcoreyuimodulesDefault file store for application cachesEdit mappings,Edit sharing,Purge

Summary of cache lock instances.

NameTypeDefaultUsesActions
Default file lockingFile locking3
Add a new lock instanceChoose...File locking

Stores used when no mapping is present

ModeStore mappings
ApplicationDefault file store for application caches
SessionDefault session store for session caches
RequestDefault static store for request caches


Cache store performance reporting - 100 unique requests per operation.

Test with 110100500100050001000050000100000 requests

Store requests when used as an application cache.

PluginResultSetGet - HitGet - MissDelete
File cacheTested0.15280.02130.00230.0945
MemcacheInvalid plugin----
MemcachedInvalid plugin----
MongoDBInvalid plugin----
Session cacheUnsupported mode----
Static request cacheUnsupported mode----

Store requests when used as a session cache.

PluginResultSetGet - HitGet - MissDelete
File cacheTested0.15830.02150.00220.0929
MemcacheInvalid plugin----
MemcachedInvalid plugin----
MongoDBInvalid plugin----
Session cacheTested0.00020.00010.00010.0001
Static request cacheUnsupported mode----

Store requests when used as a request cache.

PluginResultSetGet - HitGet - MissDelete
File cacheUnsupported mode----
MemcacheInvalid plugin----
MemcachedInvalid plugin----
MongoDBInvalid plugin----
Session cacheUnsupported mode----
Static request cacheTested0.00020.00010.00010.0001

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't want to get hung up on this... but someone needs to know how your server is set up. 

Slow disk subsystems are a common problem. As has been mentioned running the performance report is also a good idea. After that, it probably gets tricky!

In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Hi Howard.

We are running this server for only five courses right  now, three different teachers, about 30 students in each course.  Concurrently, there may be up to 40 users on Moodle at any given time.

We have a Windows 2012R2 Server.  10 GB RAM, 2.67 Ghz Processor. 500 GB Hard drive.  We are running MySQL.

I turned on the page performance footer.  On the slow pages, I notice the following parameters.

The slow pages are the Grader Report, anytime I duplicate a Quiz, anytime I change the "Restrict access to Groups" feature on a Quiz, Assignment or other Activity.  It is also SLOW anytime I save grades, even on "Single View".  I tried collapsing some of the columns in the Grader Report, or showing only one Group at a time and it does not make it any faster.

All other functionality response quick and well...loading in less than 2 seconds.

So, for example, page stats on Performance for the Grader Report (the other slow areas I mentioned above also have similar stats):

Load time:  691.11 seconds

Memory Used:  18.6MB

Files Included: 282

DB Read/Write: 18798/10665

I do notice the cursor is a little slow to move when editing in the grader report and it loads even slower when editing is turned on.


These numbers, especially the DB read/write seem very high.  

Most pages are loading something like this:

Load time:  1.28 Sec

Memory Used:  6.9 MB

Files included:  200

DB Read/write:  55/1



I hope this information is useful enough that you can make a suggestion.  If not, tell me exactly what you are looking for and I will find it.  We did convert the tables to Barracuda format this week, slightly faster but not enough to make a significant change.

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Have you run the performance report yet?

Other than that, you need some monitoring software on your server to work out what it is doing when Moodle grinds to a halt. Unfortunately, I know next to nothing about Windows so can't be much of a help when it comes to specific tools. What you really need is something to monitor key server parameters over time and produce some graphs. You can then (hopefully) see where the pinch-points are. 

I would also try to see what the database is doing when it is hung up. Even just looking at the database process list can give some clues (e.g. long running, 'slow', queries). MySQL can also be configured to log slow queries. But, again, we don't really know where the problem is (yet).

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Oh, I also wanted to be clear. The specs you gave are for a real server, yes? The sort in a box you can go somewhere and point at? That's as opposed to those are just the settings you selected in a VM. Reason being that some VMs are pretty dreadful.

In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Yes.  Those are the stats for the real server.  


Thank you Howard and community for any suggestions.  I will be back with the performance report.

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Jason Touw -

Howard - As for the performance report, do you want the stats from Moodle, from the Windows Performance Monitor, or some other?  Let me know which report you are looking for...Thanks.

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Jason Touw -

OK - beating my head against the wall here so turning to anyone that can help.  Here are a few more symptoms...just to recap:

We recently migrated our courses to our own in-house Moodle on a Windows 2012R2 Server.  We use the build v 3.0 with IIS and MySQL

10 GB RAM, 80 GB Hard Disk, 2.67 GHz Processor, dedicated.

Opening the gradebook is not a problem.  Opening grader report, usually in under 3 seconds.  Single view, any of them just fine.

Scenario #1:  Edit the grader report.  Collapse the table to show only the information you need.  The more grades you change during one session in the grader report, the longer it takes to load.  The theme loads, the header loads, it take up to 10 minutes for the table to load!!  Performance monitor on Windows Server shows less than 50% during this time.

Scenario #2:  Edit a quiz or assignment.  Go into the quiz or assignment.  Change anything BUT the grade category.  If you change the category and click save, be ready to wait at least five minutes.

Scenario #3:  Single View Grades.  Same thing.  Edit nothing and click save, the page reloads fine.  Change one grade, the theme and header loads, wait one minute for it to return the page saved.  Change 10 grades, wait almost 10 minutes.

Here is the interesting part:  Open a new TAB, go to moodle.  NOTHING.  You cannot open a new moodle page until the grades are finished saving.  Doesn't matter which page you attempt.  **SO HOW ABOUT THIS**  Go incognito on your browser, or open a different browser, say IE.  Homepage loads fine and nothing slows down.  HOWEVER, DO NOT CLICK THE GRADEBOOK or anything to do with it.  If you do, your browser is stuck until the grades save in the original browser window.


So, do we think this is a gradebook thing, Webserver, Moodle setting, MySQL???  I am all ears.

THANK YOU to anyone that read this!


In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We're going round in circles. You really will need to run some monitoring on your system to (hopefully) see what is sucking up all the power/memory when you load these pages. There's no getting around this. If a page takes 10 minutes to load, *something* must be happening during that time - Moodle is doing something or waiting for something. If the Windows performance monitor doesn't show anything then you need a better performance monitor. Did you look at the MySQL processlist like I previously suggested during these times?

There's a thing called 'Performance Overview' in Moodle that several people have asked you to run. Have you done it? It's here... Site administration > Reports > Performance overview. 

There's also a whole bunch of stuff here - Performance_recommendations - which you should read and consider. 

Sorry - but I'm pretty sure we're not going to be able to wave the proverbial magic wand over this problem. It requires some debugging.  And, in the nicest way, I don't have enough hours in the day to keep repeating myself wink

Average of ratings: Useful (1)
In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Hi Howard:

I did check that report.  Didn't find much that would be of help (at least yet)



As for the Performance data on MySQL, I am a Windows person, so I am accessing MySQL through the Workbench utility.  I am fine running command prompts if I know the exact string to use.  Moodle 3.0 came with MySQL 5.5.36.  When I try to access the Performance Dashboard or reports, MySQL tells me this feature requires version 5.6 or newer.  I am learning MySQL.  Would you recommend that I upgrade the MySQL to a newer version than what came with our Moodle build?  (I assume it is ok to do that without upgrading Moodle)


At least for now, I do have some logs to share...with this error from MySQL: (and notice the performance is greyed out)


Howard and others....you really are great folks for helping me (and our district) get this going!!  You deserve many badges!

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Moodle doesn't "come with" MySQL at all. If you mean what I think you mean that you used the Xampp "one click" installer for Moodle then you should be aware that these installers are not intended for production use. They are only for evaluation and testing purposes. 

In reply to Howard Miller

Re: New Moodle Slow saving grade changes

by Jason Touw -

Howard - 

Under Environment, I did see this message, and I found that you have some postings regarding Barracuda.  Could this be the root of my slow gradebook?

Environment

Check how your server suits current and future installation requirements
Moodle version3.0 upwards

Server checks

NameInformationReportPluginStatus
moodleversion 2.2 is required and you are running 3.0+ (Build: 20151204)OK
unicodemust be installed and enabledOK
databasemysql (5.5.36)version 5.5.31 is required and you are running 5.5.36OK
phpversion 5.4.4 is required and you are running 5.4.25OK
pcreunicodeshould be installed and enabled for best resultsOK
php_extensioniconvmust be installed and enabledOK
php_extensionmbstringshould be installed and enabled for best resultsOK
php_extensioncurlmust be installed and enabledOK
php_extensionopensslshould be installed and enabled for best resultsOK
php_extensiontokenizershould be installed and enabled for best resultsOK
php_extensionxmlrpcshould be installed and enabled for best resultsOK
php_extensionsoapshould be installed and enabled for best resultsOK
php_extensionctypemust be installed and enabledOK
php_extensionzipmust be installed and enabledOK
php_extensionzlibmust be installed and enabledOK
php_extensiongdmust be installed and enabledOK
php_extensionsimplexmlmust be installed and enabledOK
php_extensionsplmust be installed and enabledOK
php_extensionpcremust be installed and enabledOK
php_extensiondommust be installed and enabledOK
php_extensionxmlmust be installed and enabledOK
php_extensionintlshould be installed and enabled for best resultsOK
php_extensionjsonmust be installed and enabledOK
php_extensionhashmust be installed and enabledOK
php_settingmemory_limitrecommended setting detectedOK
php_settingfile_uploadsrecommended setting detectedOK
php_settingopcache.enablerecommended setting detectedOK

Other checks


InformationReportPluginStatus
unsupported_db_table_row_formatif this test fails, it indicates a potential problem

Your database has tables using Antelope as the file format. You are recommended to convert the tables to the Barracuda file format. See the documentation Administration via command linefor details of a tool for converting InnoDB tables to Barracuda.


In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

So you might start with the Antelope fix that that page is pointing you too and see if that helps anything.

I would also recommend doing a cache purge just to see if that helps - sometimes a corrupted cached page will wreak all kinds of havoc!

In reply to Emma Richardson

Re: New Moodle Slow saving grade changes

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Jason,

Along with the other suggestions so far, while you are tracking down this problem, you might want to try turning on Performance Info. It can be accessed at Administration > Site Administration > Development > Debugging. Keep an eye on the first item in the list, secs, when you have this on. From the description of your equipment, you should easily be getting less than 1 second on most of your Moodle pages. It has helped me in the past to isolate a slow page as being caused by a link to an external site on a Moodle page where the link was incorrect and we were being forced to wait for a timeout to complete.

Also, this is doubtful and I hate to admit it but this happened to me once or twice, make sure that under Appearance > Theme settings, that Theme designer mode does NOT have a check-mark in it.

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Change the theme back to Moodle default one. Your site just brought: "Version warning: Theme not designed for Moodle version. Unexpected issues may occur, please get the correct theme version for your Moodle version."

The "More information" link points to https://docs.moodle.org/30/en/error/admin/accessdenied.
In reply to Visvanath Ratnaweera

Re: New Moodle Slow saving grade changes

by Jason Touw -

I did try other different themes before and no luck.  I will try the default theme, however, to see if that makes a difference.  Thanks for the suggestion!

In reply to Jason Touw

Re: New Moodle Slow saving grade changes

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The error messages I posted are a false alarm. You have pasted a deep link from your site, which is only available for the admin!
In reply to Visvanath Ratnaweera

Re: New Moodle Slow saving grade changes

by Jason Touw -

OK - update and then maybe put this to rest.

I updated the theme to 3.0 version.  No difference in load times.  I tried the default theme.  No difference in grade changes load time.

Here is where there is a difference:

I went into a new course, created several grade items, saved them, made changes, works great.  The new course I used had 29 students and 20 grade items.

Now, back to the old course (that was an import from Moodle v2.8).  Where are we?  74 students and 120 gradebook items (Assignments, Quizzes, manual grade items).  That is because this course is four quarters (the entire school year, Sept-June) and three periods (groups) of students.  All I can figure is that this large gradebook size is causing the slow changes.


Average of ratings: Useful (1)