ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

"Controller Execution Time" very slow

October 15, 2012 11:21pm

Subscribe [4]
  • #1 / Oct 15, 2012 11:21pm

    Rodscha

    35 posts

    The development of my first EE site went great. Because of this good experience I decided to stick with EE. But 2 of my now 4 EE sites have very frustrating performance issues. It often takes 10 sec or so to load pages with almost nothing on them. This makes it almost unusable. I did develop all sites quite similar so it’s a mystery to me why some of them have those speed issues. Those sites with problems aren’t very complex. No third party extensions are in use and I’m pretty sure the traffic on this sites is rather low. I really don’t know what to do or what to look for in order to solve it. And I reached a point where I’m almost at a point thinking to give up using EE completely.

    But earlier today I came across a forum thread that gives me hope. Someone had quite similar issues as I currently have:
    http://ellislab.com/forums/viewthread/211614/

    As suggested in this forum thread I opened the Template.php file and commented the following line out (around line 170):

    //$this->EE->functions->clear_caching('page');

    ...which improves speed dramatically for one of my problem sites. Why? What is it for exactly? And according the the forum thread this is just a problem identification and not a fix. So how do I fix this?? The forum thread sort of stops when it gets interesting. I’m also pretty lost when it comes to setting file permissions. The numbers don’t mean much to me and I’m never quite sure if I do this step right. Can incorrect/incomplete file permission cause loading times of 15 sec?

     

  • #2 / Oct 16, 2012 4:29pm

    Robin Sowell

    13255 posts

    Hi Rodscha.  Quite honestly, I don’t know that you need page caching on unless you’ve run into issues with speed first.  So- I’d likely turn off all caching and enable it selectively.

    That said- we still want EE to be able to perform those ‘clear cache’ type actions.  The reason it slows down- it’s trying to delete the files in that folder and waiting for that to happen.  And waiting.  And waiting.  Well- that’s often what happens.  Sometimes it does have permission but the cache is filling up so fast it can’t keep up with it.  In which case- you really need to turn caching off because it’s doing more harm than good.

    I suspect it’s the first case, just a matter of permissions.  You can see if this works.  Go in, delete the page cache folder, create it again using ftp, and make sure it is chmod to 777.  Surf around the frontend, let the cache fill up a bit.  Go to ‘Tools- Data- Clear Caching’ and clear all caches.  Check in the page cache- did it empty out?  If so, it’s an ownership issue and you should be ok going forward.  But you will need to create your folders via ftp rather than relying on ee.  You could also contact your host, let them know the problem, and see if they can tweak the settings.

    But my first suggestion:
    1. See if creating the folder via FTP helps;
    2. Turn off caching unless you have a situation that clearly calls for it, and then use sparingly.

    That help?

  • #3 / Oct 16, 2012 6:23pm

    Rodscha

    35 posts

    Robin, thanks for getting back to me regarding this. I want to go through the steps you suggested but want to make sure I’ll do it correctly.
    – You’re saying “Go in, delete the page cache folder”: Do you mean go in via FTP and delete the actual folder “page_cache” in SYSTEM>EXPRESSIONENGINE>CACHE?
    – Before I surf around should I uncomment the line I commented out before (inside Template.php)?
    – I’m not sure what you mean with “But you will need to create your folders via FTP rather than relying on EE”. What folders? Where and when?
    – I have no idea where and how to do this one “and make sure it is chmod to 777.”

    Thanks again for you help!

  • #4 / Oct 17, 2012 4:34pm

    Robin Sowell

    13255 posts

    Ah, sorry for the lack of clarity.

    1. I would go in and delete the page cache folder and create it using ftp.  Then chmod to 777.  (That could vary by server, but start there unless you know otherwise).
    2. Go in, uncomment that line in template.php so that it will clear cache.  (Not critical, but better not to forget.)
    3. Surf around the frontend.  Watch the cache folder- is page cache getting files added to it?  Once you have some new files added….
    4. Go to tools, clear all caches. Now- look in your pages cache folder- be sure to ‘refresh’ ftp.  Did it clear things out?  If so- it was a matter of who owns the files- EE was unable to delete them when created by apache.

  • #5 / Oct 18, 2012 12:09am

    Rodscha

    35 posts

    I’m still not sure what do in the first step when you suggest “Then chmod to 777”. This is setting file permissions, correct? The site runs on MediaTemple servers and I don’t know where to make the adjustments. I can’t contact MediaTemple either since I don’t know what to ask for, really. I attached a few screenshots where I think those adjustments will be made. Not sure if I’m on the right track here. Maybe you can give me some more details about this. Thanks!

  • #6 / Oct 18, 2012 9:45am

    Robin Sowell

    13255 posts

    Ah, ok.  I generally do this using my FTP client (I use Transmit for Mac).  Pretty much any ftp client will allow you to change permissions somehow- so might be worth checking yours.

    That said- you can do it via the interface you’re showing me.  That top one where you have page_cache circled?  K- on the ‘Edit File’ page, select all of the options.  That’s 777. 

    EE needs some files/folders to be writable- you can see which ones in the Installation docs.  And then EE will create some files/folders on its own as well.

    Like I say- it’s generally easier to do this via ftp, at least for me.  But just make sure those files/folders have the permissions put forth in the installation docs.

    777 will be ‘check everything’ on the edit page.
    666 will be check all the ‘read’ and all the ‘write’.

  • #7 / Oct 18, 2012 6:56pm

    Rodscha

    35 posts

    Thanks for explaining what the file permission numbers mean and that you can adjust this with the Transmit FTP client. I really needed this.

    Transmit didn’t let me delete the folder “page_cache” but it finally let me set the permission to 777 after I did the same thing with the parent folder “cache”. Without setting permission for “cache” to 777 first, “page_cage” reset to the previous setting (not 777) automatically. But now it seems to stick. Is deleting and re-creating the page_cache folder via FTP crucial?

    I read through EE’s File Permission docs again and noticed that some folders on my server have incorrect settings. Does it make sense or is it sufficient enough to correct those still or is it too late to do this?

    The page cache folder empties out when I clear all caches from within EE/tools.

    You mentioned earlier “But you will need to create your folders via ftp rather than relying on ee”. I’m not sure what folders I need to create and where/when. Just “page_cache”?.

    I’ll now check the performance of the site. It seems to have improved quite a bit.

    If file permissions are so important to the overall performance the EE docs should really explain those steps in more detail. Maybe with a few examples. It’s really the first time I get this and I read through the installation docs at least 5 times.

  • #8 / Oct 21, 2012 9:15pm

    Rodscha

    35 posts

    After leaving this issue alone for a day or so I (and the people who are trying to use this site!) noticed once again a page load slowdown. I checked and the permission (777) I set to the page_cache folder where automatically reset to 755. This happens right after I clear the cache from within the EE CP. Why? Is this a hosting issue? Will the same happen if EE clears the cache automatically?

    So I’m forced to comment out that line of code again inside Template.php. Which isn’t the solution just the problem detection, correct?

  • #9 / Oct 22, 2012 5:14pm

    Shane Eckert

    7174 posts

    Hey Rodscha,

    That does sound like server issue. Not sure what would cause the perms to change on that folder, but something is.

    Do you have selinux or a cron job running that might be changing perms?

    Thank you,

  • #10 / Oct 22, 2012 11:58pm

    Rodscha

    35 posts

    Hi Shane, thanks for your reply. I’m using MediaTemple servers and an didn’t adjust anything there. I’m a user with low demands and use their default settings unaltered with nothing extra installed. And I admit I have no clue what “selinux” and “cron job” means. What I’ll do is write them a support message to find out if they have an idea why the permissions change. To be sure I just tested again and yes: as soon as I clear the cache from TOOLS>DATA>CLEAR CACHING the permissions of the page_cache folder change from 777 to 755. And I assume that the same thing happened when EE cleared the cache automatically (when that line of code inside Template.php is not commented out).

    I’m a bit surprised that this hasn’t been an issue with more EE users. It really slows down a low traffic site to a degree where it can’t be used anymore. And I’m pretty sure I’m not the only one on MediaTemple servers.

    Interesting also might be that this hasn’t been an issue at all with sites I built with EE v2.2.2. There’s no page_cache folder…

  • #11 / Oct 24, 2012 10:10am

    Shane Eckert

    7174 posts

    Hi Rodscha,

    I think you probably want to just turn it off, as Robin suggested.

    If you would like, I can log in and do this for you.

    What do you think?

    Cheers,

  • #12 / Oct 25, 2012 12:03am

    Rodscha

    35 posts

    I already turned off all the caching inside the Template Manager / Edit Preferences. If there’s more to do in regards to turning cache off please let me know.

    The section in the Template.php file (mentioned somewhere above) is still commented out. Page loads are still slow although not quite as slow as before. But it’s still frustrating.

    As expected the hosting support replied saying it’s not an issue on their end (with the automatic permission reset). So I’m still very much wandering in the dark about this all. Again, those performance and page load issues haven’t been an issue for me in EE v2.2.2 and earlier. Is there any more information around in regards what I can do to trouble shoot this?

    Thanks.

  • #13 / Oct 25, 2012 8:28pm

    Shane Eckert

    7174 posts

    Hi Rodscha,

    I am thinking that it might be much easier to troubleshoot if I log in and take a look.

    Please be on the lookout for an email from EllisLab.

    Cheers,

  • #14 / Oct 25, 2012 9:48pm

    Rodscha

    35 posts

    Thanks Shane, that would be great. It’s 2 sites I have very similar issues with. Just yesterday I experienced problems with one of them (roeger.tv) although the cache related line of code is still commented out inside Template.php. Seems to work better at the moment. Only difference was/is that about 30-40 people (I know of) were using this site yesterday when it slowed down. I use that site for teaching and some students were reading, a few publishing content.

    For the other site (condonandroot.com) the Template.php is fully “uncommented” and a few pages still have caching enabled.

    Thanks much for your help! I just replied to the email with login information.

  • #15 / Oct 29, 2012 3:12pm

    Shane Eckert

    7174 posts

    Hey Rodscha,

    Awesome! Thank you.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases