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.
Do you have Administration > Site Administration > Appearance > Theme settings > Theme designer mode activated?
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.
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! ;)
+ max_connections= (default is 151) and
as well as some innodb specific settings like:
Tuner will have suggestions ... am almost certain!