Slowness of Moodle

Slowness of Moodle

by Heather P -
Number of replies: 15

Hello

I'm having issues with the speed of our Moodle.

We are moving onto newer servers and the later SQL server, but it isn't getting any faster.

We are on windows servers 2019 and the latest version of SQL. We are using php 7.4

I've put the bench marking plugin on and it is picking up these two as being slow.

Reading file performance
Read a file multiple times to check the reading speed of the Moodle temporary folder

Writing file performance
Write a file multiple times to check the writing speed of the Moodle temporary folder

It suggests checking the hard disk.

I'm getting the same response whether I have the data folder on the local hard drives or on a distant symlink elsewhere.

On the local disk - we are on virtual hosts, so no actual disk to prod as such.

Anybody got any ideas how to improve the speed. I've looked at the Moodle documentation page for optimisation, but I think the help for Windows is a bit old now and not particularly helpful.

At this stage I'll clutch any straw. Any ideas much appreciated.

Thank you
Heather

Average of ratings: -
In reply to Heather P

Re: Slowness of Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Did you search for similar discussions? Here is a recent one: write performance issue with OCI FSS.
In reply to Visvanath Ratnaweera

Re: Slowness of Moodle

by Heather P -
Thank you.
I've had another hunt around and the gaps in my knowledge could swallow the planet. Sadly the link above is all Linux and Oracle and I'm Windows and SQL.

I've got a VM Windows server sat on NetApp.
From what I've managed to glean, and it isn't much, a NetApp device can be used for a variety of purposes. It has an OS of ONTAP.
I can't imagine we would put a VM server on a device that had slow read write speeds, but you never know. Has anybody else got this kind of set up?
Thank you
Heather
In reply to Heather P

Re: Slowness of Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
You are right. When we dive in to the operating system, the majority of us automatically take Linux. It is the reference OS in many areas including Moodle. There are a couple of in-house Windows experts but you have to give them some hard surface to stand on, ideally numbers, not descriptions. The Moodle Bench you've mentioned in the OP is a good one, but then attach the full output like in this post https://moodle.org/mod/forum/discuss.php?d=435860#p1753996.

P.S. To get the attention of the in-house Windows and performance experts, you might want to ask the moderator to shift this discussion to the Hardware and performance forum.

In reply to Heather P

Re: Slowness of Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Not all VMs are equal. Like a lot of people around here, I know absolutely nothing about windows. However, some OSs aren't very good at running VMs (or being a VM host). It may be true that the disk subsystem in the VM is super slow. This will definitely kill your performance.

A good place to start is to configure your cache/MUC to use a proper cache server (e.g. Redis) as Moodle's caching (performance critical) uses disk as standard.
In reply to Howard Miller

Re: Slowness of Moodle

by Heather P -
I've tried pointing the data folder at a random solid state drive and that didn't help particularly either. We are wondering about file system, but not entirely sure.
I've started looking at Redis, but at the present time it doesn't seem to be officially supported on Windows. So not ideal if we want to go for cyber essentials.
However that said - caching does seem to be a good shout and one I had missed.
In reply to Heather P

Re: Slowness of Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
> I've tried pointing the data folder at a random solid state drive and that didn't help particularly either.

In what sense? Did Moodle Bench report remain unchanged? But we haven't seen the full Moodle Bench report yet. See my previous post https://moodle.org/mod/forum/discuss.php?d=435799#p1754019.
In reply to Visvanath Ratnaweera

Re: Slowness of Moodle

by Heather P -
Bench mark report
System Benchmark
Benchmark Score: 1034 points
# Description Time (seconds) Acceptable limit Critical limit
1 Moodle loading time
Load the "config.php" configuration file 0.034 0.5 0.8
2 Processor processing speed
Call a PHP function with a loop to check the processor speed 0.179 0.5 0.8
3 Reading file performance
Read a file multiple times to check the reading speed of the Moodle temporary folder 1.366 0.5 0.8
4 Writing file performance
Write a file multiple times to check the writing speed of the Moodle temporary folder 7.364 1 1.25
5 Reading course performance
Read a course multiple times to check the reading speed of the database 0.450 0.75 1
6 Writing course performance
Write a course multiple times to check the writing speed of the database 0.111 1 1.25
7 Database performance (#1)
Run a complex SQL query to check the speed of the database 0.097 0.5 0.7
8 Database performance (#2)
Run a complex SQL query to check the speed of the database 0.231 0.3 0.5
9 Login time performance for the guest account
Check the loading time of the guest account login page 0.392 0.3 0.8
10 Login time performance for a fake user account
Check the loading time of a fake user account login page 0.111 0.3 0.8
Total time 10.335s
Score 1034 points

That didn't paste very well.
Maybe try an image


Thank you
In reply to Heather P

Re: Slowness of Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Interesting. The first thing: A very good Moodle Bench result, say below 100, doesn't mean that the server is scalable. The Moodle Bench is a negative test. If the result is bad, then the server is bad.

I your case, eight out of ten measurements are excellent. But the other two, the file reading takes 3.5 longer and file writing 6.5 longer than the accepted limit. Those two are very bad! They are going to show somewhere, shine through whatever make up you put with cache servers. (Notice that, here I differ from Howard.)

Now the next question: Where does it show? Do you or users feel is subjectively? What are the scenarios? Or, do you have some measurements, numbers? You read https://docs.moodle.org/en/Performance_recommendations, right? What Moodle release? What plug-ins?

What is the hardware underneath? I assume IIS and SQL Server run on different VMs. What virtualization technology? Does it serve other applications? How much is the host loaded? What is the load on the VM when you observe slowness?

Well, I don't know how to find out those things in Windows. I am just explaining what I would do, independently from the platform.
In reply to Heather P

Re: Slowness of Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
A good cache server isn't really a nice to have. You could just run up a Linux server somewhere and put Redis on it.
In reply to Howard Miller

Re: Slowness of Moodle

by Heather P -
Hi
Thank you, but Linux really isn't an option. We have no Linux skills.
We did try Moodle on it for a few years some time ago, but we just couldn't support it properly and it made everyone nervous in terms of - what if the worst happens.
So we are stuck with Windows and making it work on there.
I think we are down to what can we do with caching on the Moodle side of it. Is there an IIS setting for some other Caching that we need to look at too, I'm sure I saw something, but a lot of the info is for IIS 7 and we are on IIS 10.
What is the file structure that the data folder is sat on and is there something we can do to make that faster.
At least I think those are the key suspects now, which is definitely a step forward on where we were.
In reply to Heather P

Re: Slowness of Moodle

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 gathered, but building a Linux-based, Redis "appliance" should not tax anybody unduly. It'll probably be less trouble than the other things you are looking at.

Sorry - I have never even seen IIS.
Average of ratings: Useful (1)
In reply to Howard Miller

Re: Slowness of Moodle

by Heather P -
Hi
Thank you and I do love the enthusiasm and you are probably right that something else will be harder.
However it might not tax anyone but there is this bit on the redis site:-
"Install Redis on Windows
Use Redis on Windows for development
Redis is not officially supported on Windows. However, you can install Redis on Windows for development by the following the instructions below."
In order to be insured against cyber attacks we have to evidence that we are doing everything we can to mitigate any cyber related issues. That line alone - 'not officially supported' would probably wipe out the insurance. As British Further Education seems to be a target for cyber attacks, for no obvious reason - being the cash strapped part of Education, I can't risk the college losing its cyber insurance.

It would possibly negate the spirit of Redis too, as it would not be for development - it would be a production Moodle site.

Anyway - I'm now looking at Memcache as I seem to have managed to get it installed and php is recognising it. All I have to do now is make something use it, either the IIS or the Moodle or perhaps even both? At present I've failed to make either of them take advantage of it.
Thank you
In reply to Heather P

Re: Slowness of Moodle

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 try not to get into the Windows/Linux thing. Use what gets the job done for you. However, sometimes Windows clearly isn't getting the job done and you have to look at more suitable alternatives. At least be open to looking.

1. Download and Install Ubuntu Server to a VM or whatever
2. Sign in
3. sudo apt install redis 
4. Lock down the box in your network config.
5. There is no 5, that's it  

AND... it's usage is incredibly common and fully supported. 

Just my $00.02 as our American cousins say.
Average of ratings: Useful (1)
In reply to Heather P

Re: Slowness of Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Re. memcache - In Moodle go to Site administration > Plugins > Cache > Configuration. You need to set up a Memcache instance and then point everything to it in the settings right at the bottom of the config page. (From memory)

I'm sure you know, but beware memcache vs. memcached. They are completely difference cache servers with stupidly similar names.
Average of ratings: Useful (2)