Obscure Problem Causing Excessive Load Times

So I’ve been puzzling over something for a bit now. I believe this shows the story best:
Debugger Timeline

That only happens with the site being live. I have developed a child theme locally and am using a Vagrant box (provisioned with a Homestead per-project setup) which runs Nginx. On the VM, the Render time is inline with what it should be <100ms. However, as soon as I push it up to MediaTemple, the render time goes to 10+ seconds with averages being 30 seconds (not milliseconds).

I’ve tried disabling almost every plugin, including the admin panel, but nothing seems to make a difference. Overall, the performance improved when I disabled my child theme and went with the parent Twenty theme. This is how I have my child theme declared:

enabled: true
streams:
    schemes:
        theme:
            type: ReadOnlyStream
            prefixes:
                '':
                    - user/themes/childtheme
                    - user/themes/twenty

I’ve kept an eye on grav.log, but the main issue there is one in admin.php line 295 which is throwing the error:

Call to a member function isUpdatable() on a non-object

I have OPCache enabled on the server and MediaTemple’s GRID service is run with SSD’s and typically does quite well with serving pages quickly.

I’m not sure where to look into this problem. The admin load times are just as slow as the frontend.

Are there problem spots that I should look for in my child theme that might be slowing it down? Any ideas on how I could rectify this elusive issue?

Thank you!

Also, here is the relevant section of my system.yaml file:

cache:
  enabled: true
  check:
    method: file
  driver: auto
  prefix: 'g'

twig:
  cache: true
  debug: false
  auto_reload: false
  autoescape: false

assets:
  css_pipeline: false
  css_minify: true
  css_rewrite: true 
  js_pipeline: true
  js_minify: true

Hmm, this is a very odd one. I would say you have something in your Twig that is ‘expensive’ as your slow speed seems to come from ‘rendering’ specifically.

However, you say this runs fine on your local, so that indicates that something is happening specifically on your server only.

So questions that spring to mind.

  1. Are you using the same Vagrant VM on the mediatemple?
  2. What version of PHP is this?
  3. Do you have a user cache in place like APCu, or falling back to file-based?
  4. Can you try a simple Grav skeleton and see if that produces the same slow down? (that would help determine if its something related to your content+plugins+theme, or just your server).

Maybe you could zip up your site and provide me a link so I can download it and try it locally?

I’ve been on MediaTemple for nearly half a dozen years now, and almost any time I have run into an odd issue it has revolved around the version of PHP (as rhukster queried) I have set for that domain in their dashboard. If you have not changed it for a while, it is likely not current. I would start there.

Thanks for the help, guys. Rhukster, is there a way to PM you? I’d share the site with you as well. To answer your questions:

  1. No, I’m not using a VM on the server. I’m running it with the pre-installed software. Their shared hosting is limited in terms of customizations.
  2. I’m running PHP 5.5 FastCGI (good thought, DarryllD, but I am running with 5.5. I don’t think it would even work with the default 5.3).
  3. I do not have a user cache in place. I could put it on there, but it seems there is a deeper problem unrelated to that. Especially because locally it works very well.
  4. I just pushed a base Grav installation to the server and it has roughly the same problem. Clearing the cache takes about 10 seconds and page load time is still about 30s (with more of a focus on config, which is interesting. With the new site, I’m not seeing any logs show up yet.
    Home___Grav

As soon as I posted that, I noticed that it appears that the page load in the screenshot was just a one-off occurrence due to cache-rebuilding. So it appears that the empty Grav install is working well.

BTW if you want to PM, just hop on our Gitter.im chat (top right corner of the site) I’m on there and you can instant message me too.

It turns out the MediaTemple’s GRID doesn’t get along well with Grav. It seems that the hosting was entirely the problem as after moving to Rochen, I am getting extremely fast and consistent load times across the entire site (exactly what I expected from Grav). I contacted MT support about the problem, and initially, they recommended upgrading to a VPS or something similar - how awesome is that? He also suggested a site that provided metrics on the site performance and … it rated the site horribly. I called them this morning and the rep suggested that I try the new GRID which they launched today.

All that to say, do not use MediaTemple to host a Grav site. Evidently, their file system is overloaded or just not able to handle much file loading.

For a company that cut their teeth serving up Flash sites, that’s pretty lame. Glad you figured it out though.