Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
Number of replies: 28

Hi everyone,

I’m experiencing significant performance issues with my Moodle site, which is hosted on a shared server. For the past six years, I’ve been using this setup with two courses and around 300-400 secondary school students, typically without any major issues. However, recently the performance has deteriorated sharply.

Here are the symptoms:

  • The site runs smoothly for a few minutes, then becomes unresponsive for a few minutes (often returning a 503 error).
  • I checked the Resource Usage page in cPanel and found that the I/O usage limit is frequently being reached.
  • The I/O usage graph shows many "faults," along with "IOf" entries, and a few peaks in "NprocF."
  • There is also significant database usage, with some instances exceeding the 1MB/s limit imposed by my hosting plan.

Interestingly, when my Moodle site is down, my WordPress site on the same server remains accessible without any issues.

The hosting company suggested that the problem might stem from database processes exceeding the limits, but I’m unsure how to verify this.

My Questions:

  1. How can I determine whether Moodle is the cause of the high database I/O?
  2. What steps can I take to reduce the database I/O caused by Moodle? Would deleting old courses help?
  3. Additionally, what do the "faults" and "IOf" mean in the Resource Usage graph?

Any insights or advice would be greatly appreciated!

Thank you!

Attachment Faults.png
Attachment IO usage.png
Average of ratings: Useful (1)
In reply to Hang Wong

by Eduardo Kraus -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Olá Hang Wong! 😄

Que bom que você trouxe essa questão para o fórum, porque esse é um desafio comum para quem utiliza o Moodle, especialmente em servidores compartilhados. O Moodle é um software robusto e, com o tempo, à medida que a quantidade de usuários, cursos e atividades aumenta, o consumo de recursos do servidor também cresce.

Como Reduzir o I/O no Moodle:

Ativar cache de conteúdo:

Uma excelente prática é habilitar um sistema de cache. No Moodle, você pode ativar o Redis ou Memcached para reduzir o número de consultas feitas diretamente ao banco de dados.

Usar uma CDN:

Um dos principais truques para aliviar o seu servidor é implementar uma CDN (Content Delivery Network). Isso vai reduzir drasticamente o tráfego de arquivos grandes (como vídeos e imagens) que o seu servidor tem que lidar, passando essa tarefa para a CDN. Eu escrevi um guia super detalhado sobre como usar a BunnyCDN para otimizar o Moodle. Vale a pena conferir 👉 Guia de Otimização do Moodle com BunnyCDN.

Servidor Compartilhado:

Embora seja possível rodar o Moodle em um servidor compartilhado, você já está sentindo na pele que essa pode não ser a solução ideal a longo prazo, especialmente com o crescimento de sua base de usuários. Considerar uma hospedagem dedicada ou um VPS pode evitar muitos desses problemas no futuro. 😉 Em testes que fiz, quase 95% das requisições não foram direcionadas para o Moodle, resultando em uma significativa otimização dos recursos do servidor:

Captura%20de%20Tela%202024-09-20%20a%CC%80s%2011.34.47.png

Espero que essas dicas ajudem a aliviar a carga do seu servidor e a melhorar o desempenho do seu Moodle! Se precisar de mais ajuda, estamos aqui para isso! 😊

Eduardo Kraus
Teacher e Programador 👨‍🏫💻

In reply to Eduardo Kraus

Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Eduardo Kraus -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hello Hang Wong! 😄

I was responding to Brazilian forums, and this one slipped by, so I ended up sending it in Portuguese.

It’s great that you brought this issue to the forum because it’s a common challenge for those using Moodle, especially on shared servers. Moodle is a robust software, and over time, as the number of users, courses, and activities increases, the server resource consumption also grows.

How to Reduce I/O in Moodle:

Enable Content Cache:

An excellent practice is to enable a cache system. In Moodle, you can activate Redis or Memcached to reduce the number of queries made directly to the database.

Use a CDN:

One of the main tricks to alleviate your server load is to implement a CDN (Content Delivery Network). This will drastically reduce the traffic of large files (like videos and images) that your server has to handle, passing that task to the CDN. I wrote a super detailed guide on how to use BunnyCDN to optimize Moodle. It's worth checking out 👉 Moodle Optimization Guide with BunnyCDN.

Shared Server:

While it’s possible to run Moodle on a shared server, you’re already feeling that this may not be the ideal long-term solution, especially with the growth of your user base. Considering dedicated hosting or a VPS can prevent many of these problems in the future. 😉 In tests I conducted, almost 95% of the requests were not directed to Moodle, resulting in significant optimization of server resources:

Captura%20de%20Tela%202024-09-20%20a%CC%80s%2011.34.47.png

I hope these tips help ease the load on your server and improve your Moodle's performance! If you need more help, we’re here for that! 😊

Eduardo Kraus
Teacher and Programmer 👨‍🏫💻

In reply to Eduardo Kraus

回應: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
Thank you for your prompt response.

I'm on a limited shared hosting plan lacking Redis and Memcached. I’m using Cloudflare CDN, but I need an urgent remedy for performance issues since I can't upgrade my hosting plan this year.

Over the past six years, I’ve only run two courses with about 300-400 users total each year. With the completion of old courses, I’m puzzled as to why Moodle requires increasingly more resources to manage such a small user base.

Any advice on optimizing performance under these conditions would be greatly appreciated!
In reply to Hang Wong

Re: 回應: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
300 to 400 users is still quite a lot if they are all online at the same time.

There's one thing you can guarantee - new versions of *any* software never requre *fewer* resources.

You don't give us any clues about the resources available in your shared hosting but shared hosting is rarely adequate to run a production Moodle site.
In reply to Hang Wong

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

503- some server-side applications will reject requests with a 503 status when resource thresholds like memory, CPU, or connection pool limits are met.

One cannot compare resources needed by a WP to resources needed by a Moodle. Moodle does way more, thus requires way more resources.

Where is your WP in relation to moodle?
Is the moodle in a subdirectory of your WP site?

On shared hosting you probably cannot install software ... like MySQL Tuner ... which would be a very good tool to see what's going on with DB server.  Yes, cPanel does have a tool to check DB server and might ID some issues, but that tool doesn't give enough specifics.

DB server is probably also shared.

Moodles only grow when used ... they don't shrink.

Why would you want to delete courses ... if they are hidden and no students can access them, they aren't in play.   Deleting them might relieve stress on DB and get under Inode limits one usually finds on shared hosting , but may not do much for performance and site usage.

Hosting provider probably won't be much help as they usually draw a line at applications customer is running.   Besides, hosting providers normally don't have staff familiar with Moodle.

Me thinks, the bottom line for you ... upgrade to a VPS ... where you do have more resources and are in control of allocating the resources of that server .... something you cannot do on shared hosting.

Comment: don't know how helpful a response in Spanish did ya ... that would have to be translated into another language and translations sometimes loose meaning and specifics.  

My 2 cents!

'SoS', Ken

In reply to Ken Task

回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
Thank you for your help!

To clarify, my Moodle site is hosted on the main domain, while my WordPress site is on a subdomain.

I’m concerned about the high database I/O on my Moodle site. In phpMyAdmin, I noticed that the database runs "select" queries over 8.5 million times per hour, even with virtually no students using the site. Is this typical for a small Moodle installation?

As you mentioned, Moodle tends to grow over time. However, since my old courses are finished, activities are completed, and past users no longer log in, does Moodle still require this level of database I/O to maintain them? Would deleting old courses and users help reduce database I/O usage?

Lastly, I am considering a VPS for better performance, but I need to secure funding first. I hope to make that transition next year.

Any insights would be greatly appreciated!
Attachment database01.png
Attachment database02.png
In reply to Hang Wong

Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

Site Admin
Reports
Performance Overview

Any Status that is not OK?

Statistics
Performance may be affected by statistics processing. If enabled, statistics settings should be set with caution.
More info
Enabling this will process the logs in cronjob and gather some statistics. Depending on the amount of traffic on your site, this can take awhile.

During this process, it will consume more server resources and may affect performance.

Automated backups
Performance may be affected during the backup process. If enabled, backups should be scheduled for off-peak times.

Enabling automated backup will automatically create archives of all the courses on the server at the time you specified.

During this process, it will consume more server resources and may affect performance.

How often is your cron job set to run?   That's outside of Moodle Admin.   Recommendation is once per minute.   Most shared hosting doesn't allow that frequency - and one might limited to once per 30 minutes.    That could cause task in the overall cron job to be put into adhoc-task - which is a que of task/jobs to be completed at a later time  because it could not finish.

When someone/anyone goes to your site, are they forced to login to see anything ... or does your front page show categories/courses?

What are you using for a theme?   The fancier the theme, normally, the heavier the process just to display - more caching.

You are assuming that anyone/thing headed to your site is doing so for legitimate reasons .... what does your server's error logs look like?

On shared hosting you do not have any tools to view the health of your databases that would make recommendations for tweaking config of DB server.   In your config.php file for the site, is the DB server localhost or is it pointed to a remote DB server?

Specs of server:

How much memory does your shared hosting server have?

cPanel of server - right column normally has stats - like Inode limits and counts.   Any of those getting close to maxing out or show that they have reached max's at times?

And to put Howard's question about students ... do you conduct your F-2-F class using Moodle as a resource during that F-2-F? (async or sync)

Are you using any Chatrooms in your courses?   Those typically spawn a chat server and uses up about 512M of memory per chat room.

So there are all sorts of things to look into.

'SoS', Ken

In reply to Ken Task

回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -

Thank you for your detailed explanation.

I haven't enabled "Statistics" or "Automated backup," so everything in the "performance overview" shows "OK" except for an error in the "Database schema check." This error relates to the question plugin "Formulas":

qtype_formulas_options
column 'answernumbering' has default 'abc', expected 'none' (C)

I’m unsure how to resolve this error, but the plugin seems to be functioning fine.

Regarding the cron jobs, I’m using Moodle’s default settings. When users access my site, they land on a page that lists my courses. I’ve hidden all legacy courses, leaving only two active courses.

I’m using the default theme without any modifications—no chatroom, no fancy features, and no large files. The site mainly serves as a platform for students to take online quizzes with random number questions, along with some small PDFs for download.

In the error log, I've noticed a few dozen instances of this message recently:

Exception ignored in shutdown function tool_log\log\manager::dispose: Error reading from database

These errors occurred at a similar frequency even when the website was running smoothly a few months ago. My database is hosted locally and not on a remote server.

My server specifications include 1GB of physical memory, which I have never exceeded. However, the performance issues might be related to I/O usage. The Resource Usage page in cPanel indicates that the 1MB/s limit has been reached over 100 times per day, even with just me accessing the site.

While writing this reply, the site timed out multiple times, displaying error code 524.

Any insights or suggestions would be greatly appreciated!

Average of ratings: Useful (1)
In reply to Hang Wong

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

1GB of physical memory
"Never exceeded" ... sorry .. shared server won't allow you to exceed.
So that little cPanel info is useless.

Cron job is setup outside of Moodle in cPanel.
https://docs.moodle.org/404/en/Cron

If you followed directions for setting that up it should be pointed to your
servers php-cli and /code/admin/cli/cron.php
looks something like:
/usr/local/bin/php /var/www/html/m44sb/admin/cli/cron.php

And if you followed directions to the letter, there's a redirect on the end of
it  >/dev/null means you really don't know if cron and the task are working all the time.
I dare say they are not ... given error 524.

From a google search on error 524 apache

"Error 524 is an HTTP status code that occurs when a web server takes too long to respond to a client request. The error is associated with the Cloudflare CDN (Content Delivery Network)."

You've shown black background screen clips.
Do you have Terminal access via cPanel?
If you do, click it and at the black screen prompt type: top ENTER KEY.
Then watch it.   
At the top of top ... you'll see 
Notice the memory of various processes.

The heaviest process in moodle is QUIZ and associated grading/gradebook.

The biggy/bottom line .... 1 Gig of total memory.
That has to handle web service and DB server ... since you say DB server is local and of those best performance if ..... IF .... one can get the DB to be in memory of server ... less disk I/O which is an item you have mentioned.

On shared hosting one has only a slice of that shared server ... and you don't know how many customers share that server.

Bottom line: server doesn't have enough memory to do what you are trying to do ... period.
I don't care what you set in moodle ... can squeeze only so much juice out of X% of X (small) slice of an orange!

'SoS', Ken

In reply to Ken Task

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

Follow up to own posting but probably should have started with this!

4.4.0 is first release of 4.4.
A .0 to me, means, basically, you are an 'omicron tester' - one should expect issues.  Best if you are using command line git for versioning cause it's very easy to acquire the point releases in a matter of minutes.

Moodle 4.4. is now 4.4.3 - there have been 3 point releases which includes fixes to bugs as well as security fixes.

https://moodledev.io/general/releases/4.4/4.4.3

If what you are experiencing is a bug ... there could be a fix to it in 4.4.3.

Still, I think it's a memory issue.

My 2 cents!

'SoS', Ken

In reply to Ken Task

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The Moodle partner I work for (Catalyst EU) has worked on several performance related issues over the last 12 months and some are now in core Moodle so it is worthwhile looking into the various MDL tickets to see what has happened. The reason I say some are in core and not all, is to do with the process of quality control, not because we would not like them all in core if appropriate.


Performance is a difficult area, but I like the level of detail included in this question. Note if you are thinking of moving to a new provider to get better performance next academic year it might make sense to get that system as soon as possible and move some students over to it so you can check out any issues as early as possible.  

In reply to Ken Task

回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
To All,

Thank you, everyone, for your help.

Since I’m on a starter shared hosting plan, there’s not much I can do about the server configuration, and I don’t have terminal access through cPanel.

I’m unsure about the accuracy of the statistics in cPanel, but the graph shows typical memory usage around 200-300MB and CPU usage below 10%. However, the I/O usage consistently exceeds the limit.

I upgraded my Moodle version to 4.4.3 yesterday and purged all the cache, but unfortunately, that didn’t help with the performance issues.

I’m currently working hard to secure temporary funding to upgrade my server. My plan is to move to a better shared hosting option with a 4MB/s I/O limit in the near future to see if that resolves the performance issues.

I appreciate any additional insights or advice!
In reply to Hang Wong

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

You wrote:
> Since I’m on a starter shared hosting plan, there’s not much I can do about the server configuration, and I don’t have terminal access through cPanel.

That is why Performance_FAQ#What_hosting_provider_do_you_recommend? says, "Cheap 'shared hosting' may not provide sufficient resources to run Moodle properly." That doesn't say what a "proper" site is, but "two courses and around 300-400 secondary school students" could be one depending on the operation, say they have a strict time table that causes peak usage hours. Especially if they take on-line tests (with the Quiz_activity) or use submit files all together in an Assignment activity or use the Chat intensively, to name the heaviest activities among the board activities.

> I’m unsure about the accuracy of the statistics in cPanel, but the graph shows typical memory usage around 200-300MB and CPU usage below 10%. However, the I/O usage consistently exceeds the limit.

Notice that certain hosting providers limit the IOPS by throttling file access which leads the PHP scripts to break causing the 503 errors you see.

> I upgraded my Moodle version to 4.4.3 yesterday and purged all the cache, but unfortunately, that didn’t help with the performance issues.
 
What did you expect? The latest and the shyniest Moodle to be also the most efficient? Generally speaking, it is the other way around. The newer versions get features added all the time, which in turn needs tuning. On the other hand, the LTS, like the 4.1 LTS don't get feature updates since December 2023 and is more "stable". https://moodledev.io/general/releases

> I’m currently working hard to secure temporary funding to upgrade my server. My plan is to move to a better shared hosting option with a 4MB/s I/O limit in the near future to see if that resolves the performance issues.
 
I don't know how many here measure the "power" of a server on "I/O limits" or in "ø per hour". The usual matrices are the number of (virtual) CPUs, their clock frequency, RAM type and their speeds, R/W performance of the storage system. Talking of which, did you test your the performance of your hosting by running the Moodle Benchmark.
 
>  I appreciate any additional insights or advice!
 
It is all in the Moodle Docs linked to this forum, specifically Performance and Performance_FAQ.
 
Since you are stuck with the present hosting, if you provide the details as requested in Before you post.. read this.. you'll have better chances of getting specific advice. 
In reply to Hang Wong

Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Saw this only after I gave a generic answer a short while ago:
> I noticed that the database runs "select" queries over 8.5 million times per hour, even with virtually no students using the site. Is this typical for a small Moodle installation?
>
> As you mentioned, Moodle tends to grow over time. However, since my old courses are finished, activities are completed, and past users no longer log in, does Moodle still require this level of database I/O to maintain them?

No, not at all! In a "quiet" Moodle site, the DB queries should get stabilized. You need to investigate what the Scheduled_tasks say.
In reply to Visvanath Ratnaweera

回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -

I appreciate everyone’s input!

I suspect that the million queries per minute shown in phpMyAdmin reflects the total number of queries across the entire server, not just my website. I also checked the task log, which indicates that all scheduled tasks are completing successfully—approximately 18 tasks run every minute.

Additionally, can anyone explain the "faults" mentioned in my earlier post? Are they normal for a Moodle site?

As I mentioned before, my website has run smoothly for six years with the same server settings, but recently, I’ve been experiencing frequent timeouts. 

In reply to Hang Wong

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> I suspect that the million queries per minute shown in phpMyAdmin reflects the total number of queries across the entire server, not just my website.

Another reason why shared hosting is not for "proper" Moodle use.

> I also checked the task log, which indicates that all scheduled tasks are completing successfully—approximately 18 tasks run every minute.

That is more humane.

> Additionally, can anyone explain the "faults" mentioned in my earlier post? Are they normal for a Moodle site?

Not a common matrix in these forums. Looks like something specific to Cpanel, see https://support.hostinger.com/en/articles/4725774-how-to-check-resources-usage-on-cpanel.

BTW, what is your web hoster and which package? Where are the other information requested in Before you post... read this, etc.? Or do you depend on the magical powers of the helpers here?

> As I mentioned before, my website has run smoothly for six years with the same server settings, but recently, I’ve been experiencing frequent timeouts.
 
Obviously changes have happened during those six years. What were they: server side and usage side?
 
Notice that with shared hosting there is a factor not transparent to you, let alone the community on moodle.org: the hosting provider over committing their servers. 
In reply to Hang Wong

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

"can anyone explain the "faults" mentioned" ....

Not really ... none of us host where you host! :|.  Guess: faults are errors - pushed over limits set in shared hosting setups.

"my website has run smoothly for six years with the same server settings"

There is no sense in repeating the above.  6 years ago is a long time ... and hosting anywhere (with any provider) has also become more complicated - case in point the fact your provider offers CloudFlare.

So I'd strongly suggest focusing on present issue.

Ok, you are going to look into your providers higher offerings for shared hosting.   Kinda like jumping out of the pan into the fire but, it might be the only thing you can afford at present.

BEFORE you do that, I'd try to do 2 things:

  1. backup the active courses you have and download those backups.
  2. make a site backup - which is an archive of code directory, a DB dump, and minimally an archive of moodledata/filedir/

When you make course backups, do not ... repeat DO NOT ... get in a hurry and put the backup in a background process ..... stay on that screen before going to next course.

Before you do that ... check phpinfo page in Moodle Server to see settings for time outs ... and using cPanel tools increase those  x2 if you can.

You need to backup your WordPress site as well.

And that's another thing ... those 'faults' you are assuming are due to Moodle ... not clear that is true.   What's going on with your WordPress?

The cPanel app that allows you to see error logs sucks.  Snapshot of the last 30 or so lines and it's not in realtime.

CloudFlare is a web application firewall and it does it's thing due to DNS trickery ... the FQDN of your Moodle and WordPress point to CF for CDN (caching) and 'protection' ... but that only works if black hats are using the FQDN of your server.   Black Hat's are not that stupid .... they use IP address of your server.

Now shopping for a new hosting provider ... like I said before ... out of the pan and into the fire potential.  One thing you know you need ... more memory ... but that and that alone isn't the only thing to research .... just about everything that is required to run a 4.4.highest moodle ... php version + php extensions required to run a 4.4.highest, MySQL/MariaDB version.

And  a biggy - does new hosting offer a Terminal icon in cPanel?

You might use that, but if you ever hire someone to trouble shoot your moodle, that's probably one of first things that support person would ask ... why?   There are php scripts in code/admin/cli/ which are command line only that do solve lot's of problems!

OK - again strong suggest before going further ... backup your courses and down load those  do a site backup and download those.

'SoS', Ken

Average of ratings: Useful (1)
In reply to Ken Task

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The "faults" are intriguing. If the machine throws faults then the results must be wrong!

Here is another random web site on this: https://www.fastcomet.com/kb/cpu-and-memory-usage-cpanel and another one https://www.reddit.com/r/webhosting/comments/pulezq/does_cpu_faults_in_cpanel_resource_usage_cause/?rdt=58892.
In reply to Ken Task

回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
Apologies for the earlier incorrect statement about terminal access. I can access the terminal through cPanel, which allows me to install MySQLTuner and run it.

The report suggested some changes to database settings, but unfortunately, I don't have root access to implement those changes.
In reply to Hang Wong

Re: 回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

That's good!

What did tuner recommend?

Didn't you say before that DB in config.php of your site was localhost?

If so, then you should be able to make changes to DB config.

Also, is nano and tar present?

If so you can use tar and mysqldump from command line to make a site backup.

And you can run the backup.php script in code/admin/cli/ to backup courses and save those backups (mbz file) to a destination outside of moodledata/filedir/ where you could then use cPanel to download them.

Something else to check:   env |grep $PATH [ENTER]

At the tail end of that, do you see something like /home/[yourlogin]/bin/

If so, you can create your own bash shell scripts from command line by:

mkdir bin

cd bin

Then using nano, create your bash shell script.

And, to expand upon that, you could also install moosh in there ...

And we should be able to be very specific bout your server resources:

uname -an

free -h

df -h

Still, that doesn't do anything about your memory issue.   But for some things ... like course and site backups, those run from CLI take CloudFlare and your web service out of the loop, and you stand a better chance of completing those.

'SoS', Ken

In reply to Ken Task

Re: 回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

What does DB server line say in your config.php of moodle code?

I don't re-call if it was TMD Hosting or not, but some cPanel/Cheapo setups had 'passwordless' mysql client as root user to localhost DB's.

Since you have CLI access, do this from initial terminal screen:

find ./ .mycnf    See the 'dot' in front of the filename?

If you find that, you can cat it: cat .mycnf to see contents.

'SoS', Ken

In reply to Hang Wong

Re: 回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Jerry Lau -

the last of your sentence is the key.

Because your database is shared with other organizations, the hosting provider does not allow access nor changes to database settings. If they did, it would create problems for other of their customers.

Your only option is to have a dedicated database (or web) server on your own and spend some extra more money if you want "full" (even this could be limited as they may or may not allow certain changes due to security, company policy, etc.) control to make changes for your moodle environment

In reply to Hang Wong

Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
How much do you pay for your hosting?
In reply to Marcus Green

回應: Re: 回應: Re: 回應: Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Hang Wong -
I’m currently using the TMDHosting starter plan, which costs $5.99 per month when paid triennially. For the first three years, I was able to get it for just $2.99 per month.
In reply to Hang Wong

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Whether that needs "funding" depends on where you are. In the developed world, a cup of coffee in Starbucks is around $ 5.99. You drink one coffee less each month and the future of the hosting is guaranteed. No need to talk of the $ 2.99 here. What is it? A butter croissant? In a developing country the case is the opposite. A labourer toils a full day under the burning sun and not a drop of Starbucks coffee. Yeah, a VM needs serious funding there.
 
And in the capitalist world anything and everything can be expressed in $ $ - even fully abstract things like loss and pain. Ask a specialist there, he'll convert your trouble and the kids suffering with the failing shared hosting to $ $ which you need to compare to the savings in going from VM to shared hosting.
 
The good thing is, unlike Starbucks $ $ is a universal language, something the developed and the underdeveloped both understand and feel.
In reply to Visvanath Ratnaweera

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

School teachers don't calclate their hourly rate.   If they did, they might decide to pursue something else!   OP said site primarily quiz - for around 300-400? students.  So how long does it take to produce a pencil and paper quiz and grade 300-400 of them?  X hourly rate = ?  Is that near cost of a VPS?   Concept ... 'paying' yourself! smile

Another tid bit ... according to OP's profile, hails from what is known as 'the Las Vegas of China'!

As long as I am at it ... OP is single teacher ... surely there are other teachers in OP's school who would like to save some time giving/taking/grading test.   Maybe they would chip in on hosting cost?

How about parent 'donations'?

'SoS', Ken

In reply to Ken Task

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
[OT] Never been to any one of the Las Vegas, so can't visualize their special character. Do you mean like the famous China towns there are also Las Vegas towns which share a culture? Then how about partnering with the original mother Las Vegas? I read that US are even recommissioning abandoned nuclear reactors to put new data centers. Their crumbs could power those 300-400 poor youngsters and hopefully future casino players. Then the world will have less dumb farmers who excoriate in the sun rather than going straight to Starbucks.
smile

Way off-topic. [/OT]
In reply to Visvanath Ratnaweera

Re: Seeking Help with Moodle Performance Issues (Moodle 4.4.0)

by Ken Task -
Picture of Particularly helpful Moodlers

Well, my suggestions were really not OT ... OP paying for hosting out of his own pocket - seeking additional funding from other resources ... Vegas equates to someone having wealth and those persons might spring for some $ to support OP.  Could be a parent!!!

Other teachers where OP teaches another potential source of additional funding to be able to afford a VPS - and handle the other courses those teachers would set up on system.

The bottom line is still memory and greater control over server.

'SoS', Ken