Server Speed or Cart Speed Problems

My web site started to slow down about a month or so ago. What is the best way to determine if my server is the problem or if its something with my cart or MySQL?



I have been looking over some of the posts about tweaking CS-Cart, but i have not discovered the right combination yet.



The admin pages seems to be slower then the index pages on the site.





Steve

Version: 1.3.5-SP1

Hi


  1. Keep all pictures in File system not DB !!!
  2. Use Semi or Dedicated server only
  3. Generate Static HTML pages
  4. Disable certain Java functions
  5. Use Debug Mode to see which part slows down loading.



    That’s what I have done and now pages load quickly. [Semi-Dedi]

It used to be that everyone in the forum would recomend that you must get a VPS, now more and more are starting to say you must get “Semi or Dedicated”. The bottom line is CS is pulling from the database TOO MUCH or you would not have to get more and more on the server. I am still operating another site that does NOT use CS and it flows faster and smoother. CS needs to figure out how to stop pulling from the database so much so this cart will operate better. The sad part is most people who buy CS are buying a low priced shopping cart. While CS does have a lot of awesome bells and whistles, they really need to get the speed issue taken care of!

I ran CS on a shared server and it was just as fast and sometimes more stable then on the VPS I have now, I think the mistake people are making is they decide to host with godaddy or powweb where they have 30k+ accounts on 1 server…

[quote name=‘snorocket’]I ran CS on a shared server and it was just as fast and sometimes more stable then on the VPS I have now, I think the mistake people are making is they decide to host with godaddy or powweb where they have 30k+ accounts on 1 server…[/QUOTE]



Sno… We are using dedicated server



[url]| Aplus.net



and are having nightmares… on average we get 2-3 emails each day from customers that your site is slow… no modifications… standard cs-cart

smav - Yup, seems your site is slow. Just started to happen? Or just changed servers? Or just upgraded CS?



sno - We have been on a shared server from the beginning using a local ISP, and I think quite a few other sites are on it as well. But it’s beefy and seems fast enough for us, especially using the DB for pics and our pics being quite large. I think shared is fine as long as the ISP’s security and server horsepower is up to snuff.



Bottom line it seems to me, is that CS is pretty darn good even with its minor? flaws (DB calls, some bloated code, etc.). It’s the server and ISP issues that people usually discover as the culprits when performance suffers. Not always, but most times.

[quote name=‘wwgreen’]smav - Yup, seems your site is slow. Just started to happen? Or just changed servers? Or just upgraded CS?[/QUOTE]



We upgraded 135SP4 recently and it seems to be slower… we even got upgraded memory on server to 2GB (extra $20/month :mad: ) and has not made any difference… Per Aplus its the Cart that is making too many queries and Aplus support tells the next resort will be server upgrade to $169/month [url]| Aplus.net :confused: I don’t think my business can support that much of expense per month on server only.

smav - Not sure what you mean by SP4, 1.3.4 only goes to SP3 I think.



Anyway, I’m no expert, but maybe someone else can look at your links from aplus and see if those specs are enough to run any cart. I’d say your current (1st link you gave) setup wouldn’t be enough for any cart.



Time for a new ISP with better specs and prices, or did you just start with them?

[quote name=‘wwgreen’]I’d say your current (1st link you gave) setup wouldn’t be enough for any cart.



Time for a new ISP with better specs and prices, or did you just start with them?[/QUOTE]



:confused: :confused: This is a dedicated server with 2GB RAM now… only thing is with 1.7GHz Celeron.



Time to get some help/suggestion… can anyone laydown what specs one should look for CS-Cart… shared/VPS/dedicated…



TIA

Why not go with Scott and CyberLNC? From reading here it seems he is the best host for CS.?

you can also try optimizing your mysql database… it may be that something corrupted in the db itself that’s causing things to slow down



in mysql, you just run the query:



optimize table tablename for every table



also, people are talking about how many tables there are for cscart, etc… there are around the same amount of tables for like cre loaded as there are for cscart, and cre runs fine… I don’t think it’s the amount of tables that is the problem, I think it’s how they are doing the queries, either they aren’t doing cross table queries properly, or, they are doing cross table queries when doing 2 queries would actually run faster than a cross table query (I’ve seen many instances of this being the case… people do a complex query to get data from 2 or 3 tables at once rather than getting it from 1 or 2 tables, and then getting it from the 3rd table and merging the arrays) (in some cases, breaking up the queries really expidites things… I’ve seen 1 query that takes 6 seconds broken up into 2 queries that combined take 3.2 seconds)

After turning eveything off and trying each option with CS-Cart, I have determined that my problem is with the statistics.

When I have that turned on, my admin runs real slow. The store front pages also perform better with the statistics turned off. I don’t know why the admin is so slow with them on, but that seems to be my problem. Even when I deleted all the current statistics, it is still slow.

[quote name=‘“n00b website”’]The standard in basic dedicated server CPUs—the Celeron 1.7 GHz server is perfect for a back-up (storage) server or a solid web server upgrade from your shared hosting space. server upgrade from your shared hosting space.[/quote]To put it bluntly it’s a s.hitbox… Celeron’s for Servers like running a Jet on vodka… it’ll burn but not as fast as you need it to burn.



I can’t recall where but I’m sure Scott’s running a AMD Quadcore with a few gig of ram. Meh, I don’t need to know as it can’t run any faster as whats already on it.



Get off that pile-o-junk and consider investing in a decent VPS. Fast CPU, Fast RAM (and heaps of it) and connected to an internet backbone somewhere. That’s about all the advice I can provide legally :slight_smile:



PS: Just realised that the text on the website repeats itself… ironic that they’re service sucks as much as their speeling lol

[quote name=‘luckdragon’]you can also try optimizing your mysql database… it may be that something corrupted in the db itself that’s causing things to slow down



in mysql, you just run the query:



optimize table tablename for every table[/QUOTE]



Google search came up with this php script. Not a php guru… can u help to tweak as per for CS-Cart and then can be used as cron to be run everynight… or some similar thoughts…


```php

// Change these four variables to match your configuration.
// You will probably only need to change "user", "pwd" and "dbName".
$db_host = 'localhost';
$db_name = 'Database Name';
$db_user = 'user';
$db_password = 'password';

$link = mysql_connect($db_host, $db_user, $db_password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($db_name, $link);
if (!$db_selected) {
die ('Can\'t use $db_name : ' . mysql_error());
}
// Find the names of all tables in the selected db.
$alltables = mysql_query("SHOW TABLES");
// Go through all tables.
while ($table = mysql_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename)
{
// Perform the magic "OPTIMIZE" on every table in the db.
mysql_query("OPTIMIZE TABLE '".$tablename."'")
or die(mysql_error());
}
}
mysql_close($link);
?>

```

acutally… no tweaking is required… just make sure the username, password and db are defined correctly at the top, and that will run it on every table in the database :slight_smile:

[quote name=‘luckdragon’]acutally… no tweaking is required… just make sure the username, password and db are defined correctly at the top, and that will run it on every table in the database :)[/QUOTE]



second msg

$db_host = ‘localhost’;

$db_name = ‘Database Name’;

$db_user = ‘user’;

$db_password = ‘password’;





those 4 lines have to be changed to the appropriate values but otherwise, the script itself works fine

Nevermind fixed with some help



right code



$link = mysql_connect ($db_host, $db_user, $db_password);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db($db_name, $link);
if (!$db_selected) {
die ('Can\'t use $db_name : ' . mysql_error());
}
// Find the names of all tables in the selected db.
$alltables = mysql_query("SHOW TABLES");
// Go through all tables.
while ($table = mysql_fetch_assoc($alltables))
{
foreach ($table as $db => $tablename)
{
// Perform the magic "OPTIMIZE" on every table in the db.
mysql_query("OPTIMIZE TABLE $tablename") or die(mysql_error());
}
}
mysql_close($link);
?>

All I can say is thank God for cPanel. It does this and a whole lot more with just the click of a button.

smav your site is pretty slow…I don’t know what the deal is, steavecartshop is alot faster and he’s on a shared host from what I understand, it has to be the setup of the server but I agree CS is overloaded with way too many queries and this is a major problem that’s being addressed in the next release of CS, for now the first steps you need to take are, disabled all languages and currencies you do not need, disable all addons you do not need, remove all languages you do not need from the database, the cart will run slightly faster…



CS already has a db optimizer built in, down at he bottom under maintenance:

[url]Instant Demo - CS-Cart Multi-Vendor Demo Try Free for 15 days