Thursday, January 19, 2023

issues with a Moodle course

One of our institutions had some trouble with one of their courses not loading - or being very slow to load. After first suspecting server issues, some excerpts from an email exchange:

Some suggestions to make the course(s) load faster:

0. Have finished the upgrade now, and the site is working. The database table prefix_question_statistics shows a(n abnormally?) high number of entries -  that table alone is 49 MB,  with more being added every day - around 11:15 this morning a large number of records were added - this might have been one of you adding another set of questions?
 
1. Currently, if you click on one of the courses, a huge page, with many images, for all weeks, loads in the browser. We can make it load a bit faster using Cloudflare, but such a large page is bound to cause problems with older computers / machines with less RAM / on slower networks / etc. It would be better to show a collapsed view, with each week opening up only on clicking. (the collapse all link on the top right). Or on separate pages.

2. As I mentioned, please use jpg quality = 70 to 75 instead of png. 

3. I'll make the cloudflare changes to turn proxying on. 

4. Clicking on question bank also loads up 1000 questions at once. This would cause problems as the number of questions / size of each question increase. It would be desirable to load up fewer questions - maybe 100 at a time as with the link at the bottom, "Show 100 at a time" - I have clicked it now

I do not think anyone was adding questions. I have only been opening that page to troubleshoot. The problem still existed even after upgrade. However, I found a fix by disabling question statistics which seems to be triggering every time we access the question bank.
 
For now this should work till moodle finds a permanent solution for the statistics trigger. 
 
Checking the server, I found node js (which runs our notifier service) was running at 60% CPU. I have stopped it now and restarted the webserver with
cd notifierdirectory
sudo forever stop index.js
sudo service apache2 restart

So, now the site itself is loading.

https://our.site/course/view.php?id=4
loads fine.

But when I turn on edit mode, the page becomes very large, and hence loads slowly.

I guess the same issue is affecting https://our.site/course/view.php?id=6 in edit mode.
 
--Later--
 
Further troubleshooting tips -
Moodle in English: Very large course takes a minute to load unless "editing" is on

"It's almost always because somebody is trying to build the learning material on the course page itself rather than in activities/resources "behind" the page. There's nothing wrong with that, of course, but it's does have an effect.

We had a course with 120 videos embedded in labels on the course page. It took 10 minutes plus to load - even on a good connection."


So, probably not a good idea to embed all your content on the course page itself, they should be "activities/resources behind the page".

Now, whether you are already doing this, or how to do this if you are not doing this - maybe S can help.

Also, another person says:
"To track down the culprit I usually switch to one section per page. With one section per page, only the content for that pages loads, so some sections will load normally, but your dragger will still drag."

How to show one topic per page:
Course format types in Moodle · Technology Help · Lafayette College
 


 


No comments:

Post a Comment