Smarty Template Cache makes store slow and then inoperable

[QUOTE]What did you change your memory size too?



Thanks[/QUOTE]



Badd,



Knowone can really tell you the best setting for your particular setup, depends upon the amount of resources you have available on your server as well as what other programs or sites you also may have on this server.



You can just try experimenting with this setting in your config.local.php file to see if it gives you more site speed. Considering you can change it back in 1 minute if need be, there is no harm done either way.



I currently have ours set at 304M, but again, doesn’t mean anything regards to your setup. :wink:

[quote name=‘Struck’]Badd,



Knowone can really tell you the best setting for your particular setup, depends upon the amount of resources you have available on your server as well as what other programs or sites you also may have on this server.



You can just try experimenting with this setting in your config.local.php file to see if it gives you more site speed. Considering you can change it back in 1 minute if need be, there is no harm done either way.



I currently have ours set at 304M, but again, doesn’t mean anything regards to your setup. ;)[/QUOTE]



Yah, I will try tonight some more memory values after 12am since hopefully no one should really be visiting my site. I will move the memory upto 500M although I have already tried like 300M and after a few minutes my site does not even load. If I cannot sort this out then will have to send it off to CS Cart for repairs.



I only have 180 products btw…, I got another cs cart install on my dedicated box that has no problems, I have an oscommerce site and one WP setup and thats all…



btw, have you setup a cronjob to clear the cache or no need for you?

[QUOTE]I have already tried like 300M and after a few minutes my site does not even load.[/QUOTE]



Sounds as if you may not have that much memory available for use then. Won’t do you any good to bump up the memory setting if it is not available, you know.


[QUOTE]btw, have you setup a cronjob to clear the cache or no need for you?[/QUOTE]



Nope, no need so far, only time I clear the cache is after making changes to a file.

[quote name=‘Struck’]Sounds as if you may not have that much memory available for use then. Won’t do you any good to bump up the memory setting if it is not available, you know.







Nope, no need so far, only time I clear the cache is after making changes to a file.[/QUOTE]



I have got 1GB of ram

2x2gb cache

[quote name=‘tjordan’]We can’t put up with this problem any longer. I think we’ve made the decision to pay the CS guys to research and fix it. We’ll let you know what they say…[/QUOTE]



TJordan,



It may be useful to others having a similar problem if you could post back your response from CS!

[quote name=‘badmaash’]I have got 1GB of ram

2x2gb cache[/QUOTE]



Bad,



Ok, try setting it around 300-400M and see how it operates. Problem is you have to take into consideration how much resources are being used by your other installed sites on the same server.



PS: No real need to to wait for off hours to try this as you can switch it back in 1 minute if your site doesn’t respond properly!



PSS: How many daily visitors do you believe your CS-Cart store is currently seeing?

[quote name=‘Struck’]Bad,



Ok, try setting it around 300-400M and see how it operates. Problem is you have to take into consideration how much resources are being used by your other installed sites on the same server.



PS: No real need to to wait for off hours to try this as you can switch it back in 1 minute if your site doesn’t respond properly!



PSS: How many daily visitors do you believe your CS-Cart store is currently seeing?[/QUOTE]



When I switch to html catalog I lost traffic since all the urls changed so my site is starting to get back in the serps and yesterday I got 10 unique hits.



The site only works in html mode.



I pushed the memory size up-to 400M, I also tried 500M, 800M and 1000M



Whats happened was at 800M ths site worked fast enough hompage speed at 6.6 seconds.



Then after 10 minutes the load started to shoot up.



As I though from my earlier bad luck using the dynamic cart it opens lots of msql process and does not kill them, Cart load tim went up-to 5 - 10 minutes



I have the smartoptimizer script running…



Any way, I have now gone back to html cart and had to manually kill all the open mysql processes to make the site work again …



Server load is back down to 0.04 and site works good, but would like it to be a dynamic cart instead of the html one.



The other sites on the server are not usinh much of the resources at all…







Server Info



Memory Information

Memory for crash kernel (0x0 to 0x0) notwithin permissible range

Memory: 2072632k/2096896k available (2161k kernel code, 23040k reserved, 901k data, 228k init, 1179392k highmem)



Current Memory Usage

total used free shared buffers cached

Mem: 2075184 1372584 702600 0 139344 910488

-/+ buffers/cache: 322752 1752432

Swap: 2096376 84 2096292

Total: 4171560 1372668 2798892

Hello Bad,



Based on everything you say, there is definately something “outtawhack” with your install.



You dont have too many catgories, products, or visitors yet for your site to be “overloading” like that in a matter of minutes, or for the need to continually clear your cache, or run in static page mode! And, you should have plenty of resources it appears.



If I were you, I think it would be wise to spend a few support points and have the CS staff look over your install, probably the best money you could spend right now! :wink:

[quote name=‘Struck’]Hello Bad,



Based on everything you say, there is definately something “outtawhack” with your install.



You dont have too many catgories, products, or visitors yet for your site to be “overloading” like that in a matter of minutes, or for the need to continually clear your cache, or run in static page mode! And, you should have plenty of resources it appears.



If I were you, I think it would be wise to spend a few support points and have the CS staff look over your install, probably the best money you could spend right now! ;)[/QUOTE]



Yah - going to let cs cart guys deal with it now…



Thanks

[QUOTE]I have the smartoptimizer script running…[/QUOTE]



Just a quick additional thought, don’t forget to clear the contents of your /cache folder within smartoptimizer right after you clear your cache in CS-Cart. Especially since you have switched back & forth between static & dynamic to static product pages. You want to let smartoptimizer rebuild it’s cache based upon the new page changes!



But yes, please post back your response from the CS staff as there is indeed some strange behavior going on with the cache process.



And, good luck, I am sure you will get this sorted out! :wink:

I don’t know if this will help but I tried out the smart optimizer and it created such a load on my server that my account was suspended. I never noticed a difference in page loading times but I had to remove it anyway.

[QUOTE]I don’t know if this will help but I tried out the smart optimizer and it created such a load on my server that my account was suspended.[/QUOTE] OUCH!



Interesting though that smartoptimizer didn’t give you positive results Tool. :confused:



I suppose considering Badmash most likely has an entirely seperate issue going on, he would probably be best to uninstall smartoptimizer for the time being so as to not confuse things further until getting to the root of the problem.

[quote name=‘badmaash’]Yah, I will try tonight some more memory values after 12am since hopefully no one should really be visiting my site. I will move the memory upto 500M although I have already tried like 300M and after a few minutes my site does not even load. If I cannot sort this out then will have to send it off to CS Cart for repairs.



I only have 180 products btw…, I got another cs cart install on my dedicated box that has no problems, I have an oscommerce site and one WP setup and thats all…



btw, have you setup a cronjob to clear the cache or no need for you?[/quote]


[quote name=‘Struck’]Sounds as if you may not have that much memory available for use then. Won’t do you any good to bump up the memory setting if it is not available, you know.







Nope, no need so far, only time I clear the cache is after making changes to a file.[/quote]


[quote name=‘Struck’]Bad,



Ok, try setting it around 300-400M and see how it operates. Problem is you have to take into consideration how much resources are being used by your other installed sites on the same server.



PS: No real need to to wait for off hours to try this as you can switch it back in 1 minute if your site doesn’t respond properly!



PSS: How many daily visitors do you believe your CS-Cart store is currently seeing?[/quote]


[quote name=‘badmaash’]When I switch to html catalog I lost traffic since all the urls changed so my site is starting to get back in the serps and yesterday I got 10 unique hits.



The site only works in html mode.



I pushed the memory size up-to 400M, I also tried 500M, 800M and 1000M



Whats happened was at 800M ths site worked fast enough hompage speed at 6.6 seconds.



Then after 10 minutes the load started to shoot up.



As I though from my earlier bad luck using the dynamic cart it opens lots of msql process and does not kill them, Cart load tim went up-to 5 - 10 minutes



I have the smartoptimizer script running…



Any way, I have now gone back to html cart and had to manually kill all the open mysql processes to make the site work again …



Server load is back down to 0.04 and site works good, but would like it to be a dynamic cart instead of the html one.



The other sites on the server are not usinh much of the resources at all…







Server Info



Memory Information

Memory for crash kernel (0x0 to 0x0) notwithin permissible range

Memory: 2072632k/2096896k available (2161k kernel code, 23040k reserved, 901k data, 228k init, 1179392k highmem)



Current Memory Usage

total used free shared buffers cached

Mem: 2075184 1372584 702600 0 139344 910488

-/+ buffers/cache: 322752 1752432

Swap: 2096376 84 2096292

Total: 4171560 1372668 2798892[/quote]



I HIGHLY suggest AGAINST increasing the CS-Cart memory limit. Why? Allows DDoS’s to happen a lot more efficiently. If your store can’t operate effectively under 48MB then it’s time for better hardware or optimization on the server front.

Hello Jesse,



I have sorta been expecting this reply! :wink:


[QUOTE]I HIGHLY suggest AGAINST increasing the CS-Cart memory limit. Why? Allows DDoS’s to happen a lot more efficiently.[/QUOTE]



Guess I am willing to take a chance on this one, if you experience a DDOS attack, then your server can go down, however, if your site is slow you are already dead! :expressionless:

No need to set PHP memory over 256MB.





Unless your logs are showing lots of these:



[28-Mar-2010 05:05:31] PHP Fatal error: Out of memory (allocated 79167488) (tried to allocate 86 bytes) in /home/*/public_html/prepare.php on line 182
[28-Mar-2010 05:07:02] PHP Fatal error: Out of memory (allocated 31981568) (tried to allocate 1617921 bytes) in /home/*/public_html/var/compiled/admin/%%17^179^1797F5A0%%reports.tpl.php on line 579




Running sales reports from cs-cart admin uses lots of memory.





Anyway, optimize your Apache server and MySQL. Give MySQL more memory and more caching. cs-cart hits the MySQL database like there is no tomorrow.

Since you have so much memory, try optimizing MySQL.



[url]http://www.databasejournal.com/features/mysql/article.php/10897_1402311_3/Optimizing-MySQL-Hardware-and-the-Mysqld-Variables.htm[/url]



[url]http://dev.mysql.com/doc/refman/5.1/en/table-cache.html[/url]



I say set it to at least:



table_cache = 512

max_connections=512

[quote name=‘hyteckit’]Since you have so much memory, try optimizing MySQL.



[url]http://www.databasejournal.com/features/mysql/article.php/10897_1402311_3/Optimizing-MySQL-Hardware-and-the-Mysqld-Variables.htm[/url]



[url]http://dev.mysql.com/doc/refman/5.1/en/table-cache.html[/url]



I say set it to at least:



table_cache = 512

max_connections=512[/QUOTE]



cs cart have had a look at my site and they have replied saying that it is fast and works as it should so I turned on the dynamic cart and the site crashed.



I have got back to them today to ask them to look again since they have not solved my problem.



I spent half of yesterday tuning mysql and although it appeared to have solved the issue the site crashed after 10 minutes but at lower loads.



When the site crashes I see that mysql has difficulty mostly with the following query:



SELECT SQL_CALC_FOUND_ROWS products.product_id, descr1.product AS product, products.tracking, produc …



It opens it multiple times and they all are locked and stay running for ages at the same time when my site crashes.



I have another cs cart instal 2.0.12 and that install at the moment is not causing any issues.



With my 2.0.11 install that crashes the html catalog now is no longer working properly as it does not remove all the dynamic elements…



So, I guess I will have to report back later…

[quote name=‘badmaash’]cs cart have had a look at my site and they have replied saying that it is fast and works as it should so I turned on the dynamic cart and the site crashed.



I have got back to them today to ask them to look again since they have not solved my problem.



I spent half of yesterday tuning mysql and although it appeared to have solved the issue the site crashed after 10 minutes but at lower loads.



When the site crashes I see that mysql has difficulty mostly with the following query:



SELECT SQL_CALC_FOUND_ROWS products.product_id, descr1.product AS product, products.tracking, produc …



It opens it multiple times and they all are locked and stay running for ages at the same time when my site crashes.



I have another cs cart instal 2.0.12 and that install at the moment is not causing any issues.



With my 2.0.11 install that crashes the html catalog now is no longer working properly as it does not remove all the dynamic elements…



So, I guess I will have to report back later…[/QUOTE]



Seriously, optimize your mysql database.



cs-cart makes like 500 queries per page.



Easily rack up over 1 million queries in a day.



Slowest queries are:



SELECT SQL_CALC_FOUND_ROWS products.product_id, descr1.product as product, products.tracking, products.feature_comparison, products.zero_price_action, products.product_type, products.tax_ids, products.weight, GROUP_CONCAT(IF(products_categories.link_type = ‘M’, CONCAT(products_categories.category_id, ‘M’)…



and



REPLACE INTO cscart_sessions (session_id, area, expiry, data) VALUES ('f6725fab8ca091f…







Log all your slow mysql queries by adding to ‘/etc/my.cnf’


log_slow_queries=/var/log/mysqld.slow.log
long_query_time=1








Also, you might want to content your server provider about:


Server Info

Memory Information
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
Memory: 2072632k/2096896k available (2161k kernel code, 23040k reserved, 901k data, 228k init, 1179392k highmem)

[quote name=‘hyteckit’]Seriously, optimize your mysql database.



cs-cart makes like 500 queries per page.



Easily rack up over 1 million queries in a day.



Slowest queries are:



SELECT SQL_CALC_FOUND_ROWS products.product_id, descr1.product as product, products.tracking, products.feature_comparison, products.zero_price_action, products.product_type, products.tax_ids, products.weight, GROUP_CONCAT(IF(products_categories.link_type = ‘M’, CONCAT(products_categories.category_id, ‘M’)…



and



REPLACE INTO cscart_sessions (session_id, area, expiry, data) VALUES ('f6725fab8ca091f…







Log all your slow mysql queries by adding to ‘/etc/my.cnf’


log_slow_queries=/var/log/mysqld.slow.log
long_query_time=1








Also, you might want to content your server provider about:


Server Info

Memory Information
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
Memory: 2072632k/2096896k available (2161k kernel code, 23040k reserved, 901k data, 228k init, 1179392k highmem)
[/QUOTE]



Hi what exactly shall I say to them about:

Memory for crash kernel (0x0 to 0x0) notwithin permissible range

Memory: 2072632k/2096896k available (2161k kernel code, 23040k reserved, 901k data, 228k init, 1179392k highmem)





About the mysql tuning:



Current table_cache value = 1500 tables

Current join_buffer_size = 1.00 M

Current max_connections = 500





I have not enabled query caching and the only thing my tuner really highlights is that I should set:



Current max_heap_table_size = 32 M

Current tmp_table_size = 64 M



A bit higher because the is had to do some of the queries on disk



Apart from that I do not think there is much else I can do as it appears the other settings are good.





















[url]http://wiki.centos.org/Manuals/ReleaseNotes/CentOS5.1/[/url]

During the boot process you may see the message “Memory for crash kernel (0x0 to 0x0) notwithin permissible range” appear. This message comes from the new kdump infrastructure. It is a harmless message and can be safely ignored.

Ummmm my cart has run without crashing in dynamic mode and was wondering how this could be… just realised that the cs cart technicial has disabled the seo addon and this might be a clue…