rturner Posted April 19, 2012 Share Posted April 19, 2012 My host, Hostgator, has been trying to find out what could be causing the slowness on my site, www.ecg.com/new/ As I've posted earlier, the products in the Nature category (500 products) are opening extremely slowly. Today they investigate some error logs that might be slowing the site down and emailed me these, which I'm having trouble understanding enough to pinpoint anything: [18-Apr-2012 19:48:20] PHP Warning: include(/home/rturner/public_html/new/tools/smarty/cache/blockcategories^1_1_88_0^74ea0540ceb2cb9dd78e826a299a077b348427da.blockcategories.tpl.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/rturner/public_html/new/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 83 [18-Apr-2012 19:48:20] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '/home/rturner/public_html/new/tools/smarty/cache/blockcategories^1_1_88_0^74ea0540ceb2cb9dd78e826a299a077b348427da.blockcategories.tpl.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rturner/public_html/new/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 83 [18-Apr-2012 19:48:20] PHP Warning: include(/home/rturner/public_html/new/tools/smarty/cache/blockcategories^1_1_88_0^74ea0540ceb2cb9dd78e826a299a077b348427da.blockcategories.tpl.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/rturner/public_html/new/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 83 [18-Apr-2012 19:48:20] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '/home/rturner/public_html/new/tools/smarty/cache/blockcategories^1_1_88_0^74ea0540ceb2cb9dd78e826a299a077b348427da.blockcategories.tpl.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rturner/public_html/new/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line 83 [18-Apr-2012 20:39:21] PHP Warning: file_get_contents(/home/rturner/public_html/new/config/../cache/cachefs/4/4af094f8106e4ea863d147c75cb3ed0a) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /home/rturner/public_html/new/classes/CacheFS.php on line 84 The lines in the code of smarty_internal_cacheresource_file.php that are referred above are: $_smarty_tpl = $_template; include $_template->getCachedFilepath(); <---> This is line 83 if ($no_render) { return null; } else { return ob_get_clean(); From the following file: /home/rturner/public_html/new/classes/CacheFS.php if (!file_exists($path.$key)) { unset($this->_keysCached[$key]); return false; } $file = file_get_contents($path.$key); <---> This is line 84 return unserialize($file); If anyone here can figure out what might be causing these errors, I would appreciate the help. thanks, Richard Turner Link to comment Share on other sites More sharing options...
cedricfontaine Posted April 20, 2012 Share Posted April 20, 2012 Did you activate any cache option like CacheFS or memcached ? Link to comment Share on other sites More sharing options...
rturner Posted April 20, 2012 Author Share Posted April 20, 2012 Yes I did. My host told me that my Level 3 vps did not have enough resources for memcached, so they took it out, but advised me to turn on the file system cache. I did that for about an hour but the site ran even slower, so I turned it off. According to their error logs it would appear that they might refer to that. Sounds like just a temporary error? In the meantime, seeing that those errors were occurring with the blockcategories file, I tried disabling the categories block to see if the site sped up any. It didn't, but when I re-enabled block categories, now I can't pull up any product pages. I've really got my hands full. Link to comment Share on other sites More sharing options...
cedricfontaine Posted April 20, 2012 Share Posted April 20, 2012 Did you set force compile to off and smarty cache to on ? Link to comment Share on other sites More sharing options...
rturner Posted April 20, 2012 Author Share Posted April 20, 2012 Yep. But I was making that mistake when I started in November. I'm starting to think that it was a one time error back when I enabled the cache for using the file system. I'm sure I also temporarily put compile on to make sure the change went through. I should know this but I'm not sure where to find the error logs to see if it's an ongoing problem. In the Log directory in PS, I just have an index.php file but no error logs. Thanks. Link to comment Share on other sites More sharing options...
cedricfontaine Posted April 24, 2012 Share Posted April 24, 2012 The php error log depends on your php.ini settings. Ask your hosting provider where you could find the php error log. Link to comment Share on other sites More sharing options...
Aswin C. Posted July 5, 2012 Share Posted July 5, 2012 rturner, I sended you a msg . I have found the cause of it. Link to comment Share on other sites More sharing options...
Aswin C. Posted July 5, 2012 Share Posted July 5, 2012 (edited) blockcategory I meant sry ! categories on the left side... the HTML is generated. because it is a recursive query... blablabla ... heavy MySQL query + lot of time to generate all the li and sub li's so .. they try to cache the generated html output. (performance -> smarty -> cache on ) /tools/smarty/cache go watch inside such a cache file... its just html why are they so many cache files? - the category html changes for each language - for each customer group ( - for each selected category ) --> but only class="selected" actually changes here is the bug: so the programmer who wrote that is caching the output for each language * customer group * category * product !! because I have 7000 categories the RENDER of that category block takes about 10 seconds !!!! with the HTML cached he doesn't need to render anymore and just output the file ... so your website will always be "unexpected slow" until all languages for all products and categories are rendered ( and cached ) because of a "lifetime" line in the wrong place, the cache expires each hour too ... my generated html for categories is about 900KB , this times languages * categories * products ... What was the programmer thinking !!! Just for the categories only I would need 13 GB of storage 0.9 MB * 7500 cats * 2 languages = 13 GB ! = 15 000 files. clear the folder /tools/smarty/cache put smarty.config.inc.php -> debug = true and see how long it takes the block category to RENDER , revisit and it will go fast. now open a product page... and again the render takes a long time.. ( notice you now have 2 block category cache files ) So I think this is what you are experiancing, somethimes it goes fast, but then suddenly not anymore, and not always .... its just because the cache file was missing and needed to be rendered. I explained + fix here: http://www.prestasho...kcategoriestpl/ Edited July 5, 2012 by AswinC (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts