Server Slowness is causing us badly

Server Slowness is causing us badly

by Shuvendu Pattanayak -
Number of replies: 4
Hi All, 

We are facing slowness at our moodle installation. What we noticed after 30 congruent users my server is not performing well. Sometimes it is taking 30 seconds or more than 60 seconds. I don't know how to fix this problem, Our version on moodle is 3.3.1 and servers were hosted on GCP with 4 vCPUs, 16 GB memory. 

I noticed total number of 5173 queries are running in the dashboard (/my/index.php). And again when i dig in deep i found "echo $OUTPUT->header();" line is causing all these queries. Can anybody aware of this function header.php lib\outputrenderers.php? When I debug this header function I did get anything. I want to know what's going wrong inside.

If anybody knows the logic behind this function and queries.

Thanks 
Shuvendu
Average of ratings: -
In reply to Shuvendu Pattanayak

Re: Server Slowness is causing us badly

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What theme do you use? Have you compared the performance with the default theme?

Do you have Administration > Site Administration > Appearance > Theme settings > Theme designer mode activated?
In reply to Visvanath Ratnaweera

Re: Server Slowness is causing us badly

by Shuvendu Pattanayak -
No Sir, its not active.
In reply to Shuvendu Pattanayak

Re: Server Slowness is causing us badly

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Well, that was a quick test to check the obvious. There is definitely something wrong with your server - a 4 vCPU, 16 GB RAM machine must easily manage 30 concurrent users.

Now that eliminated, you have to systematically go through all the https://docs.moodle.org/33/en/Performance_recommendations. Also post the https://moodle.org/plugins/report_benchmark here.
In reply to Shuvendu Pattanayak

Re: Server Slowness is causing us badly

by Ken Task -
Picture of Particularly helpful Moodlers

Qualifications for this response ... have multiple moodle sandox sites 3.4->3.7 on a GCP site.

With GCP it really is no difference between Google vs other VPS providers with the exception of - their vision of what you need to run say a CentOS 7  or any X distro.   You've not mentioned which distro so could be CentOS 7 or 8 and/or Ubuntu 17.04/18.04 or even now 19.04?

With GCP server (all in one - code, DB and moodledata on same instance) one faces the same issues as with TMD VPS's or other.

Since you are mentioning slowness in user login and concurrent users number, much of that centers around DB server and how well it's optimized ... not so much Moodle code.

What's version of MySQL?

So .... having said that .. suggest installing MySQLTuner and run it.   Think you'll see MySQL server needs some tweaking! ;)

Settings like:

skip-name-resolve=
innodb_buffer_pool_size=
innodb_buffer_pool_instances=
table_open_cache=

+ max_connections= (default is 151) and

max_allowed_packet=

as well as some innodb specific settings like:

innodb_file_format=Barracuda

and

innodb_file_per_table=1
innodb_large_prefix

Tuner will have suggestions ... am almost certain!

'SoS', Ken


Average of ratings: Useful (1)