Hardware and performance

'core_renderer' is taking most of time while loading a page

Picture of Abdul Ghaffar
'core_renderer' is taking most of time while loading a page

Our course is getting slow day by day. By using  https://rpm.newrelic.com/, have monitored Moodle performance, where I came across a result that on rendering a page, 'core_renderer'  is taking max time as compared to all other activities. And under 'core_render', 'generate_sections_and_activities' is taking most of time as shown in attachment. These are core files of, being called once and twice on every page. Still unable to find any thing.

Details of servers are as follow

Moodle version: 3.3.2

DB Server:

CPU: Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz

RAM: 1020MiB

Web Server:

Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz

RAM: 2044MiB

Do you guys have any suggestions about how to go and fix this as i am out of ideas?

Thanks in advance.

Average of ratings: -
Picture of Ken Task
Re: 'core_renderer' is taking most of time while loading a page
Particularly helpful Moodlers

That monitoring tool requires an agent be installed on servers ... is that correct?  Agent has to run to report back to the interface you are using to monitor ... that correct?   How much memory does Agent take?  How often is Agent involved in sending data to the monitoring server?

What does 'top' from terminal look like on both servers?

Either of them using SWAP space?

On the DB server, what percentage of total memory is the DB using?

Moodle has had a long history of what's called 'the scroll of death' - a 'long' course with many sections/resources takes a long time to render. 

Not sure if 3.3.x has it (don't run a 3.3.x any more to see myself), but is there a setting for a course that shows only 1 section first, then there are navigational links to other sections?   A course that had 52 sections and displaying all sections with their resource/other links will take longer to render.

'spirit of sharing', Ken

Average of ratings: Useful (1)
Picture of Abdul Ghaffar
Re: 'core_renderer' is taking most of time while loading a page

Yes, monitoring tool's agent is installed on servers and 'Agent has to run to report back to the interface you are using to monitor', yes.

Out of two courses, one has 14 sections and  53 activities and other has 11 sections and  49 activities (much lesser than 52 sections).

And for 'top' command screenshot is shared bellow for both servers (left one for web and right one for db server).

We also are using several grading formulas in courses. And till now, no slow query found. Above shared results was for 100 virtual users load test.

Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: 'core_renderer' is taking most of time while loading a page
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Well, core_rendere is not a helpful think to focus on there. It is more interesting to focus on block_navigation and it its use of global_navigation.

Have a look at the course this performance info relates to: does it have a particualrly large number of sections and activities?

You seem to have an 11s page-load, of which 2.7 seconds is the navigation block.

For comparison, on some old profiling results I have sitting around, it was a 3.2 second page-load, of which 0.2s (6%) was block_navigation->get_contents.

So, your site seems surprisingly slow. However, there is not enough information in your screen grab to see what is really going on. (I am more used to using xhprof/Tideways - https://docs.moodle.org/dev/Profiling_PHP). As well as time, that also shows number of function calls, which is useful to see.

Ultimately, most time processing a Moodle page normally ends up being either database query or cache gets.

Average of ratings: Useful (3)