Hi
I've been hunting for days and am out of ideas.
The site:
http://electfletcher.com
The issue: extremely slow php. w/ getResources. Remove getResources and the problem goes away. But getResources is integral to this site.
I am calling it 3 times in each page; if I remove all but one, it goes away sort of...
This one takes 0.08 seconds:
[[!getCache? &element=`getResources` &cacheExpires=`14400` &parents=`2,48` &where=`{"id:!=":[[*id]]}` &showHidden=`1` &depth=`1` &hideContainers=`1`
&tpl=`Agr.sidebar` &includeContent=`1` &sortby=`publishedon` &sortdir=`DESC` &tplFirst=`Agr.sidebar.left` &tplLast=`Agr.sidebar` &includeTVs=`1` &processTVs=`1`]]
This one takes 1.8 seconds:
[[!getCache? &element=`getResources` &cacheExpires=`1800` &parents=`[[*id]]` &showHidden=`1` &depth=`1` &hideContainers=`0` &where=`{"isfolder:=":1}` &tpl=`Agr.mainbar.recursive` &limit=`12` &includeContent=`1` &sortby=`publishedon` &sortdir=`DESC` &includeTVs=`1` &processTVs=`1`]]
But this one, which only retrieves one result, takes 2 seconds:
[[!getCache? &element=`getResources` &cacheExpires=`14400` &parents=`21` &showHidden=`1` &depth=`1` &limit=`1` &hideContainers=`1` &tpl=`Agr.endbar` &includeContent=`1` &sortby=`RAND()`]]
(yes, I know that using the cache like that makes it not so random. Whatever. )
Anyway, the page flashes onto the screen after a hang.
It says that mysql is doing 0 things in 0.000 seconds, and that PHP is taking ~10 seconds.
First, environment:
(the hosting company posts phpinfo() as a publicly accessible page, believe it or not... I can give the address to you if you want... seems weird to me.)
server: Linux libraserver 2.6.35-30-generic-pae #56-Ubuntu SMP
PHP stuff...
Server API CGI/FastCGI
PHP Version 5.3.3-1ubuntu9.5
PDO drivers mysql, sqlite, sqlite2
...etc. - I can assure you that the requirements are met; if there are other specifics, just go the the /phpinfo.php file.
Server stuff...
Apache/2.2.14 (Ubuntu) w/ suhosin patch
MySQL client version: 5.1.41
PHP extension: mysql
Next, the site: it's got an A at yslow. The only thing wrong is that some of the remote stuff I can't control the expires headers. You can see how fast most things are loading, this is a highly optimized site. Sprites, minified css, post-load widgets, etc.
I sure hope someone has an idea... I love MODx, it would break my heart if I had to switch to something else. And I know this is my own incompetence, but unfortunately knowing that isn't helping.
Thanks
PS: another site which uses really similar code on MODx 2.12, and is not at all optimized in the least,
http://tuffcitypowersports.com - it loads ok, but is on a different host. So maybe a hosting thing? Permissions? that's such a black art... who knows, I always think permissions are involved somehow.