Terrible performance by Moodle

Terrible performance by Moodle

by Gerardo Ariel Moderne -
Number of replies: 19

Hello people, I am getting really terrible performance when trying to access into my Moodle server or even after login-in navigating in the site. I am not really sure what could be the issue since the machine resources seems to be always ok under load and doesn't even reach more than 70% of usage in those situations.

I will put here the info I've got about it so you can please tell me where to look at so I can retrieve more useful details you could need to give me some guidance please:

Server:
Type: EC2 Amazon t2.large
Virtualization: hvm
Number of vCPUs: 2
Availability Zone: sa-east-1a
OS: Ubuntu 16.04.5 LTS
RAM: 7.8 GB
Apache: Apache/2.4.18 (Ubuntu)
PHP: 5.6.40-1+ubuntu16.04.1+deb.sury.org+1
Data Base:
Type: RDS Amazon
Availability Zone: sa-east-1a
Class: db.t3.medium
Engine: MySQL Community
Engine version: 5.6.44
vCPU: 2
RAM: 4 GB
Storage type: General Purpose (SSD)Moodle:
Moodle Version: 3.2.1+ (Build: 20170209)
Concurrent users: 200 ~ 250
Total users: 43540
As you can see with the concurrent users I am getting trouble is barely 200 when the total number of potential users is huge, so I need to fix this ASAP and thus I am asking for your help.

I will be checking and posting whatever you tell me to since I am clueless about this right now.

Thanks a lot for your time.

Average of ratings: -
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Alain Raap -
Picture of Particularly helpful Moodlers
Are you using a caching server like Memcached? That'll give your performance a boost.
Your number of vCPUs is low, memory and CPUs is always worth upgrading.
In reply to Alain Raap

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
I am going to check that and confirm with my friend who set most of it up.
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
The discussion will be much more efficient, if that friend talks for himself.
In reply to Visvanath Ratnaweera

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
He can't speak English very well but he can read quite decently so he is looking at this thread and telling me what to answer.
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Alain Raap -
Picture of Particularly helpful Moodlers

Caching (webserver/database) will be speeding up your site. Any firewall or proxyserver that could be causing troubles?

In reply to Gerardo Ariel Moderne

Re: Terrible performance by 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
How do you define "terrible performance"? What's happening?

Is this for all users? Particular users? Doing everything? Doing certain things? All the time? Some of the time?
In reply to Howard Miller

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
Loading times are extremely high, even for login in, basically you are not surfing but slowly walking in the mud of a swamp for any course or section you try to enter. For instance, there are moments where it takes like 3 minutes or so to only being able to fully log in into Moodle.

It happens with all the users, even with the admin user I log in myself when this happen, so I am aware it is not a specific user issue but something for all (since also I got complains of others using it about the same). It usually starts okish with no many users online but reaching those values I mentioned (near 200) it starts to agonize and then it is almost impossible to use after that.

About the resources, even improving them I saw no change in the performance, so at this point I am more concerned about config or other reason behind the problem, also the machine never uses more than 70% capacity of them being the CPU, RAM or whatever, I thought enhancing them would solve the problem but it remains the same.

I am trying to get a lead so I can look specifically for something in the moodle config or maybe the apache, like I said I am kind of clueless even on what to look for at this moment, sorry for bothering you people and thanks for the help, any suggestion is appreciated.  
In reply to Gerardo Ariel Moderne

Re: Terrible performance by 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
So are you saying it's just logins that are slow? Everything else is fine?
In reply to Howard Miller

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
Sorry for being late, I am testing right now since we made chances to the current machine, but when I posted that it was when entering any course, not only in the login.
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Did you see the forum documentation https://docs.moodle.org/en/Performance_recommendations ?
In reply to Visvanath Ratnaweera

Re: Terrible performance by Moodle

by Alain Raap -
Picture of Particularly helpful Moodlers
This plugin can give an indication of the bottleneck: https://moodle.org/plugins/report_benchmark
In reply to Alain Raap

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
Ok, If i am right this is the Plugin you told us to try installing:

Moodle Benchmark Plugin Install

But then it takes a lot of time trying to install it and throw us this: 

This page doesn't work: e-learning.iga-la.com didn't send any information .ERR_EMPTY_RESPONSE

Where can I check the reasons behind that at least? So I can try to solve it or post the issue here. For now we made a "test" environment to load a copy of the production db and we could install it it there, giving us this with 1 connection:

MoodleBench2

Any thoughts?
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
What 3rd party plugins do you have installed.?You can find this out from
yourmoodle.com/admin/plugins.php?updatesonly=0&contribonly=1
In reply to Marcus Green

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -

Hello, these are the plugins already installed:

Moodle Installed Plugins

In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If you can I would try a plugin free copy and test the performance. I have seen examples where some rogue code makes everything go horribly slow.

On balance I doubt that is the source of the issue, but testing vanilla Moodle gives you a baseline to compare with other people. Other people will never have the same combination of plugins that you have so comparisons will not be valid.
Average of ratings: Useful (1)
In reply to Gerardo Ariel Moderne

Re: Terrible performance by Moodle

by Gerardo Ariel Moderne -
Updated the machine specs:

Instance type: t2.xlarge
Number of vCPUs: 4
RAM: 16Gb
I also reply above the specific posts asking about the installed plugins and the attempt to install the moodle benchmark one. I will make some new tests and put the results about them with the new machine capacity