Jump to content

My site is very very slow! Any ideas how I can improve it would be appreciated


ding

Recommended Posts

my site is http://www.timeshops.net
My server is Dedicated server,10GB Bandwidth per month.
I have set smarty like this,but my site is still very slow,always keep cpu usage at 100%

smarty.config.inc.php

$smarty->caching = false;
$smarty->force_compile = false;



Smarty.class.php

var $compile_check = false;
var $force_compile = false;
var $caching = 1;


Any ideas how I can improve it would be appreciated

Thanks!

Link to comment
Share on other sites

Hello,

(Sorry for my poor english)

I made a test :
http://www.webpagetest.org/result/100913_4TXH/

25 seconds for flags in google traduction block ! pffffiou...
You've got a big problem...

I can't identify this.

So, I can purpose an alternative :

Generate an .htaccess and use URL rewriting.

Upgrade manually your .htaccess
(example : http://code.google.com/p/molokoloco-coding-project/wiki/HtAccess )
So, if you use elements in cache, for the second connection, time will be better.

It's not suffisant, you must find the real problem.

Good luck.

Link to comment
Share on other sites

Hello,

(Sorry for my poor english)

I made a test :
http://www.webpagetest.org/result/100913_4TXH/

25 seconds for flags in google traduction block ! pffffiou...
You've got a big problem...

I can't identify this.

So, I can purpose an alternative :

Generate an .htaccess and use URL rewriting.

Upgrade manually your .htaccess
(example : http://code.google.com/p/molokoloco-coding-project/wiki/HtAccess )
So, if you use elements in cache, for the second connection, time will be better.

It's not suffisant, you must find the real problem.

Good luck.



hi,Hedrad. Thanks for your help.
I think it is ps's query problem.
Once i only add a little products ,the site is very quick.
but now my products are over 6000,my site becomes more slowly
Link to comment
Share on other sites

I think it is caused by this sql, i use MySQLAdmin to test and find that ps excutes the sql below takes a long time

/classes/categories.php

public function getProducts($id_lang, $p, $n, $orderBy = NULL, $orderWay = NULL, $getTotal = false, $active = true, $random = false, $randomNumberProducts = 1 )


$sql = '
       SELECT p.*, pa.`id_product_attribute`, pl.`description`, pl.`description_short`, pl.`available_now`, pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, i.`id_image`, il.`legend`, m.`name` AS manufacturer_name, tl.`name` AS tax_name, t.`rate`, cl.`name` AS category_default, DATEDIFF(p.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY)) > 0 AS new,
                   (p.price - IF((DATEDIFF(reduction_from, CURDATE()) <= 0 AND DATEDIFF(reduction_to, CURDATE()) >=0) OR reduction_from = reduction_to, IFNULL(reduction_price, (p.price * reduction_percent / 100)),0)) AS orderprice 
       FROM `'._DB_PREFIX_.'category_product` cp
       LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = cp.`id_product`
       LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product` AND default_on = 1)
       LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (p.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.intval($id_lang).')
       JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
       JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'tax` t ON t.`id_tax` = p.`id_tax`
       LEFT JOIN `'._DB_PREFIX_.'tax_lang` tl ON (t.`id_tax` = tl.`id_tax` AND tl.`id_lang` = '.intval($id_lang).')
       LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer`
       WHERE cp.`id_category` = '.intval($this->id).($active ? ' AND p.`active` = 1' : '').'
       '.($id_supplier ? 'AND p.id_supplier = '.$id_supplier : '');

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...