ShopWindow Forum  

Go Back   ShopWindow Forum > ShopWindow v2 Forums > ShopWindow Client Software V2 > Integration and Setup V2
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 20-11-08, 17:14
slashdot slashdot is offline
New Member
 
Join Date: Nov 2008
Posts: 1
Ways to reduce server load / turn on top level caching

Our Shop Window appears to be taking a huge toll on the server and we are looking at ways in which we can reduce this.

We have turned on the smarty caching which helps but could do with some more improvement. We noticed the top level cache folder which is empty (this is not the same as the smarty cache folder) suggesting another level of caching possible? Any suggestion on how to turn this on or any other ways in which to reduce the server load will be appreciated.

Cheers
Reply With Quote
  #2  
Old 22-12-08, 15:11
sspyrou's Avatar
sspyrou sspyrou is offline
Active Member
 
Join Date: Sep 2008
Location: London
Posts: 38
Same issue

Hi slashdot

Im having the same issues and have been experimenting with the caching...

I've changed the line in the root index.php script from:

//$oSmarty->cache_lifetime = 60;

to:

// Clear the smarty cache for docs older than 1.001 days
$oSmarty->clear_all_cache(86500);
// Iincreased cache time from 1 mins to 24 hours
$oSmarty->cache_lifetime = 86400;
Quote:
We noticed the top level cache folder which is empty (this is not the same as the smarty cache folder)
please elaborate... is there a batter way to chache these pages at hand so that i can cull by calls?

Thanks
S
Reply With Quote
  #3  
Old 04-02-09, 20:15
mrpointy mrpointy is offline
Active Member
 
Join Date: Sep 2007
Posts: 16
CPU server load

I appear to be having a similar problem.

My web host has contacted me to say that the client software is causing such a drain on the shared server I am on, that they have had to move me off of it & will terminate my hosting unless I switch to a managed/dedicated server!!

There is no way I can afford this, so I need to know how to work round this problem. They've said "productlist.php is causing CPU load."

I have a month to get this resolved, so would appreciate a response from Affiliate Window on this!!
Reply With Quote
  #4  
Old 05-02-09, 16:31
Andy's Avatar
Andy Andy is offline
ShopWindow Moderator
 
Join Date: Apr 2007
Location: A Winter Wonderland
Posts: 572
by accessing productlist.php, you could be using many different sets of files with many different output results. I would imagine they've picked on that file because a large percentage of your usage will have productlist.php in the URL. The problem could well be within any of the included files. Ask your host for a list of the problem URLs, not just the file that outputted them.

first job would be to look at your error logs. Note down your own IP address then access a page. Check your error logs for any errors generated by you on that page access.

There WILL be errors, guaranteed. Theres a good chance alot of these would be warning" rather than fatal errors. These will most likely be "Undefined index" errors.

To fix these, do sanity checks before going into loops

for instance:

PHP Code:
foreach($something as $other){
#do something
}
if $something should be an array use:

PHP Code:
if(is_array($something)){
foreach(
$something as $other){
#do something
}
}
or if it's an object, use:

PHP Code:
if(is_object($something)){
foreach(
$something as $other){
#do something
}
}
Basically, this will bypass the loop if there's nothing to loop over, which will stop the errors (or warnings) therefore cutting down on CPU usage.

If you have any bespoke code in productlist.php, check it again.

If you have any database connections, make sure that you close the connection with mysql_close().

Check that any bespoke loops have an end.

Try and find a cleaner way to write any of your bespoke code. Less code tends to mean less time to execute. Look up microtime() so you can see how long each part of your code execution takes.

basically, all you can do is check the code against your error logs and find what's making the cpu stick.

Choice of host could be a factor too. If you're on webmania, then there's your problem right there.


Caching outputted pages would definitely help, but if you have errors in the code, all caching would do is cut down on the number of times that code was executed. Yeah it'd cut CPU usage, but wouldnt fix the problem.
Fix it, then look up My.Cache.php . you'll need to register to get it.
__________________
Have I created TRUE price comparison with my Shop Window?
oooooo! How did I do that
Reply With Quote
  #5  
Old 06-02-09, 12:38
mrpointy mrpointy is offline
Active Member
 
Join Date: Sep 2007
Posts: 16
Error logs

Hmmm, unfortunately 1and1 don't provide access to Apache error logs on shared hosting packages for technical reasons!!

I'm adding some code to the individual pages to generate error logs & will see what happens
Reply With Quote
  #6  
Old 21-05-09, 08:19
acorndomains.co.uk acorndomains.co.uk is offline
New Member
 
Join Date: Mar 2009
Posts: 2
My sites are creating huge error log files and making thousands of "%%%product.tpl" files in the Smarty/cache folder.

What are these cached files for and can I turn them off? How do I do that?

Thanks
Reply With Quote
  #7  
Old 21-05-09, 13:05
Andy's Avatar
Andy Andy is offline
ShopWindow Moderator
 
Join Date: Apr 2007
Location: A Winter Wonderland
Posts: 572
Quote:
Originally Posted by acorndomains.co.uk View Post
My sites are creating huge error log files and making thousands of "%%%product.tpl" files in the Smarty/cache folder.

What are these cached files for and can I turn them off? How do I do that?

Thanks
There's a slight problem with Smarty caching not cleaning itself. Ollie posted a fix here:
http://www.shopwindowforum.com/showt...t=smarty+cache

If you want to turn it off, Simply change the Cache time to '0' in all your php files. Wont make much difference anyway, Smarty caching doesn't seem to make much difference to speed.
__________________
Have I created TRUE price comparison with my Shop Window?
oooooo! How did I do that
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 19:11.