Moodle version: 3.8.2
Lately, I was dealing with very slow page load times for Site Administrators in a specific Moodle environment.
I found out that the culprit is the the "Upcoming Events" core block which is present in courses in this Moodle environment. This Moodle environment has a significant amount of user data.
1. It seems that although the "Upcoming Events" block shows a "No upcoming events" message for the admin user, the block causes some heavy loading in the background and therefore the page load can last 4-6 seconds instead of less than a second. I assume the reason for this is that the admin has an access to all the events data in the course/system, so the query/load takes more time. However, isn't this kind of a bug if this can't turned off somehow? Do I really have to remove this block in order to fix the speed issue for admins?
2. I assume that if while loading a course page I could see in real-time:
* which PHP functions are running
* which SQL statements are running
I could understand more quickly that the "Upcoming Events" block was the culprit.
I did some search and it seems that in order to view executed SQL statement, there is the following method:
https://moodle.org/mod/forum/discuss.php?d=337187#p1359187
However. I'm not sure about doing the same for PHP. I read about PHP profiling and xdebug, but not sure it's what I need and how exactly to set it up. Could please shed some light on it?
Thanks in advance