High CPU / Maximum execution time exceeded

In my development environment I’m getting a lot of page time outs and cpu maxing out just loading pages - frontend and admin.
Because its the dev environment I don’t have much optimisation going on such as caching etc but still this is considerably slower than what I’ve been seeing a couple of days ago so I must be doing something wrong.

I have seen really high cpu once before when I had some bad looping twig inheritance going on so I wonder if this could be something similar.

One example: a modular page with 4 modules and about 5 images - so hardly a beast. The debugger seemingly shows the bottlenecks on Pages (32.14ms) and Render (50.87ms) on the front end.

How can I dig into these numbers a bit?
Any general debugging techniques I could be doing for finding the bad apple in a set of modular pages?


When I need to debug without knowing exactly the problem, I use the bisect / binary search technique:

delete all the pages. 
  does it improve?
      restore the pages
      delete the first half of the pages
        does it improve?
            repeat until you find the issue
            try the other half
      the problem is elsewhere          

Start with the pages, then with the plugins. Locally it’s easy, you remove the folders, try and then hit cmd-Z (on macOS) to restore the the previous state.

In your case, start removing the modulars. Does it improve? Then you can dig into that. If not, maybe you just need to increase the PHP memory limit.

1 Like

Thanks for the suggestion @flavio it looks like the root of my troubles is not Grav but cloud9 being particularly unresponsive lately, time to look elsewhere I think.