I have a problem with a Moodle 3.10.5 and two courses, let me explain.
I have two courses that are created on the development moodle, and we import them on the production server one week ago. This night, 200 students was their enrolment activated, and the production courses have this issue. Main course page do thousands of db queries and it's too slow, but only if I login with a manager/admin profile. Students have not this problem.
On the development server the db queries are normal (DB reads/writes: 252/1), but on the production server, that the only change is 200 active students (yesterday that students are enrolled but inactive, the enrolment was active since 0:00h of today) have several more queries (DB reads/writes: 11012/1).
I can't found the reason, the students run fine with normal db queries, but admins and managers are too slow but only on the main course page (course/view.php?id=XX)!
This is annoying because on the same production platform there are more courses that runs fine. The problem is not the server performance, is the amount of dbqueries that moodle do on this two courses, only on the course main page and with teacher and manager logged profiles. Note: these manager&teacher profiles comes inside the course .mbz package.
How can I see where that db queries come? I add the "logall
" queries on the config.php, but 11k of queries registered on the database it's hard to debug and make distinction for what is good or not.
Edit
I activate the profiling as davosmith suggest on its response, I think is a problem of Adaptable Theme, counting the active users on the course, but still weird that is doing this things when we are using this system on several courses and servers without issues. I don't know how to resolve this.