Zen Cart Logo
Forums / General Questions / Help diagnosing extremly slow loading site...

Help diagnosing extremly slow loading site...

Views: 1,232

Results 1 to 16 of 16
30 Jul 2014, 2:50 PM
#1
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Help diagnosing extremly slow loading site...

Hello everyone. I am a new Zenner, and I must say I do like me some zencart. I think I recently screwed my site up with a sql patch though, which doesn't come with an uninstall patch unfortunately. Here is the patch is question:

http://www.zen-cart.com/downloads.php?do=file&id=613

(Notice it is for 1.3.8, and my zencart version is 1.5.1 ..., not the brightest thing I ever did...)

My site is:

https://www.oldworldarchery.com

Now the reason I think this screwed up my site is that after installing this mod, it didn't work for one. And then almost instantly my site started coming to a crawl, where as I used to have a decent parse time at least. Not great due to images, but still decent. Now I am getting anywhere from 10. to 30. parse time, the site is unusable, and pretty much broken half the time. I only have around 200 products, and they all only have one attribute. And unfortunately google merchant is under going a review of my site at this time. I just optimized my images at around 80PX for small images, 300PX for medium images, and 600PX for large images, to no help. I have followed all the tutorials on zencart for speeding up your site, actually before all this happened and it worked pretty good. This is why I suspect this add-on screwed things up, and now I have no idea how to go back in time and reverse it. My hosting is shared, but I never had any problems like this before. Can any help figure out what is going on here? Sometimes it won't even load at all and just times out. The only code the sql patch has was:

ALTER TABLE featured ADD sort_order INT( 11 ) NOT NULL DEFAULT '0' AFTER featured_date_available ;

So I went into mysql and tried to just drop sorted from the featured table, which of course broke my site, :D. So I am stumped. The installation also replaced some file in admin and includes, as well as the featured.php. So I replaced those files with backup files, but I don't know if that was a bad idea or what. I had to though because the add-on made the featured products in my zencart broken.

30 Jul 2014, 3:56 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Help diagnosing extremly slow loading site...

toomanyknots:

(Notice it is for 1.3.8, and my zencart version is 1.5.1 ..., not the brightest thing I ever did...)

May not be the brightest idea, but it is a good way to learn stuff. :)

toomanyknots:

The only code the sql patch has was:
ALTER TABLE featured ADD sort_order INT( 11 ) NOT NULL DEFAULT '0' AFTER featured_date_available ;

This addition in itself will have no bearing on your problem. There would be no need to remove it. In fact doing so is likely to cause additional problems.

toomanyknots:

So I went into mysql and tried to just drop sorted from the featured table, which of course broke my site, :D.

Bummer. My warning came a little too late. I still think it worth mentioning though because a lot of people tend to go this route and end up in the same boat.

toomanyknots:

So I am stumped. The installation also replaced some file in admin and includes, as well as the featured.php.

Yes, the add-on would have had to add or replace files in order for it to function, because the default files wouldn't 'know' about this new database addition (which is why the database addition alone will never cause any problems).

toomanyknots:

So I replaced those files with backup files, but I don't know if that was a bad idea or what. I had to though because the add-on made the featured products in my zencart broken.

You did the right thing here (there is no other solution). The reason the site broke when you deleted the DB entry is because one or more of those files were/are making a reference to the DB record that no longer exists.

The fact that it is still broken means that either a new file that was added by the module hasn't yet been removed, OR there is still one (or more) files that got modified by the install that have yet to be restored. Those are the only real possibilities (unless you somehow managed to delete more than you should have from the database).

My general rule of thumb (for those that care to take note) is to never ever manually modify the database unless you know exactly what you are doing. If a module makes database changes and you later decide to remove the module (and there isn't an uninstall SQL script) then leave the database alone, because unless all the associated code additions are also reverted that could be the only thing keeping the store working..
Or putting it another way, never delete anything from the database unless you are sure that there are no files remaining that would want to access whatever it was that was deleted. The DB can have endless amount of 'junk' added to it with no ill effects (simply because the additions are ignored by all existing code). The real issues arise when new/additonal code attempts to access a DB record that no longer exists, which is the position that you are now finding yourself in. :(

The solution will be very easy... just identify and restore the files that are trying to access this now non-existant DB record. The hard part is in identifying which file(s) they may be, and sadly, you are pretty much on your own here.

Cheers
RodG

30 Jul 2014, 4:15 PM
#3
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

The file I dropped was a sorted file from the featured table. I restored a backup featured table from a back up of my sql. I wish I had backed up my sql before installing this patch. I have no idea whats going on. Do you think if I didn't delete any files in added it could be doing something to slow down things? It just happened all of a sudden, I am almost thinking of installing easy populate, save my products, and do a clean install just because if I can't figure this out I am screwed pretty much.

30 Jul 2014, 4:34 PM
#4
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

Just got 32 parse time. I am averaging probably 20 parse. This is nuts? What could be wrong?

30 Jul 2014, 4:46 PM
#5
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

It's probably an issue with an overloaded server.

30 Jul 2014, 4:47 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Help diagnosing extremly slow loading site...

While the plugin does put some old code onto your site, if you put back all the original .php files you replaced then you will remove all the effects of that plugin.

And after having done that there's no reason it should have any effect on your site's performance.

(If you leave artifacts of the plugin in your PHP files then it might be trying to do Execute instead of ExecuteRandom and MoveNext instead of MoveNextRandom when interacting with the database, and if those are mismatched (by mixing and matching the plugin's files instead of the original ZC files) then it "might" affect speed a bit. But removing all the plugin's files and putting back the original ZC files completely fixes that.)

I'm inclined to say your site's performance problems are NOT related to that plugin.

30 Jul 2014, 4:50 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Help diagnosing extremly slow loading site...

toomanyknots:

... which doesn't come with an uninstall patch unfortunately. Here is the patch is question:

ALTER TABLE featured ADD sort_order INT( 11 ) NOT NULL DEFAULT '0' AFTER featured_date_available ;
The uninstall for that would be:

ALTER TABLE `featured` DROP COLUMN `sort_order`;
30 Jul 2014, 5:01 PM
#8
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Help diagnosing extremly slow loading site...

toomanyknots:

The file I dropped was a sorted file from the featured table.

I assume that by this, you really mean that you dropped the column/field in the 'featured' table? (Databases don't tend to contain 'files')

Sorry if I appear to be a little pedantic, but it saves confusion if files (the things stored on disk) don't get confused with 'tables' or 'fields' that are stored in a database.

toomanyknots:

I restored a backup featured table from a back up of my sql.

Was this before or after you 'dropped' the 'sorted file'?

Not that it really matters at this stage, because as I tried as hard as I could to impress upon you that this isn't a database problem I somehow think that you didn't quite get the message.

toomanyknots:

I wish I had backed up my sql before installing this patch.

It wouldn't have helped you in any way whatsoever. IT IS NOT A DATABASE ISSUE (Well, at least it wasn't a database issue until you started to mess with it). It probably still isn't a DB issue, but I can no longer be as confident about this as I was originally.

toomanyknots:

I have no idea whats going on.

I know exactly what is going on. If we forget about the database for the time being, the problem is a result of one or more of the files that were changed/added by this module haven't been completely restored or removed when you attempted to uninstall it.

You may have compounded the issue by messing with the database, which now means you have TWO separate issues to solve.

  1. Removing/replacing the file(s) that are trying to use the now non-existant Database field, and
  2. Fixing any problems caused by the needless changes you made to the database whilst trying to uninstall the module.

Although #2 is a possibility, I still consider it to be a rather small one, especially since you've already restored it from a backup.

toomanyknots:

Do you think if I didn't delete any files in added it could be doing something to slow down things?

I can't comment on this particular module, but I can say that a poorly written module can cause some very serious slowdowns.

toomanyknots:

It just happened all of a sudden, I am almost thinking of installing easy populate, save my products, and do a clean install just because if I can't figure this out I am screwed pretty much.

You don't need easypopulate for this. You can export/import the entire database with phpmyadmin.. Not that it will be of any help because my money is still on the files, and your issues have nothing to do with the database itself.

Even a 'clean install' may not solve the problem if the 'clean install' is performed in the same folder(s) as the current installation unless you delete all the files that already reside there first. This is a rather drastic step to take though.

A far better option would be to open the zip file for the add-on module in question, then using this as a guide delete the same named files from your server, and finally replace them with a copy from the ZenCart distribution package (or your own current backups made before installing the module). DON'T TOUCH THE DATABASE.

You may even be able to identify the errant file by using ZenCarts 'Developers Toolkit' and performing a search for sort_order but you'll find that there are a lot of results to be found for this query, but if you find it in a file that matches one of those installed/modified by the module then that is most likely to be the culprit. There may also be more than one file involved.

Cheers
RodG

30 Jul 2014, 6:16 PM
#9
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

DrByte:

While the plugin does put some old code onto your site, if you put back all the original .php files you replaced then you will remove all the effects of that plugin.

And after having done that there's no reason it should have any effect on your site's performance.

(If you leave artifacts of the plugin in your PHP files then it might be trying to do Execute instead of ExecuteRandom and MoveNext instead of MoveNextRandom when interacting with the database, and if those are mismatched (by mixing and matching the plugin's files instead of the original ZC files) then it "might" affect speed a bit. But removing all the plugin's files and putting back the original ZC files completely fixes that.)

I'm inclined to say your site's performance problems are NOT related to that plugin.

I just went back and re-replaced all the php files with backups, just to make sure. Thank you for the clarification, I'm sure it is obvious I don't know jack about what I am doing, :smile: . Thank you for the code, I will try that out too. When I replaced the php files I overwrite-ed them, so I would think it wouldn't leave in artifacts.

30 Jul 2014, 6:26 PM
#10
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

***"I assume that by this, you really mean that you dropped the column/field in the 'featured' table? (Databases don't tend to contain 'files')

Sorry if I appear to be a little pedantic, but it saves confusion if files (the things stored on disk) don't get confused with 'tables' or 'fields' that are stored in a database. "***

Thats totally fine, I need to learn these things, so please feel free to correct me! :smile:

***"Was this before or after you 'dropped' the 'sorted file'?

Not that it really matters at this stage, because as I tried as hard as I could to impress upon you that this isn't a database problem I somehow think that you didn't quite get the message."


It was after, and I restored only the featured table, which was a back up from just a day or two ago. And I don't mean to make any impressions that I think it is one thing or another, I have absolutely no clue, which is why I came here asking for help, :D. I thought it might of been that plugin because it slowed down afterwards, but like I said I am a novice and am quite inexperienced with zencart or web design in general, so I truly appreciate any help offered!
**
*"A far better option would be to open the zip file for the add-on module in question, then using this as a guide delete the same named files from your server, and finally replace them with a copy from the ZenCart distribution package (or your own current backups made before installing the module). DON'T TOUCH THE DATABASE." ***

I have done this twice now just to be sure. So I am stumped now. So I can export my products and re-import them again into a clean install? I was going to re-build my entire site from scratch, as if I can't get this issue fixed, I don't know what else to do.

30 Jul 2014, 6:47 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Help diagnosing extremly slow loading site...

If the server is slow, especially with high parse times, then get your hosting company involved to fix the server.
A sudden increase in parse times is a server issue, not a PHP issue.

30 Jul 2014, 7:52 PM
#12
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

So should I call my hosting company (ipage, yes I know, famously bad hosting company..) ?

30 Jul 2014, 8:00 PM
#13
toomanyknots avatar

toomanyknots

Zen Follower

Join Date:
Jun 2014
Location:
hamilton, ohio
Posts:
100
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

I am on hold with my ipage CS right now waiting to speak with a tech. So if I want to attempt to redo my entire site, but I want to import my current products and categories, how should I go about it?

30 Jul 2014, 8:16 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Help diagnosing extremly slow loading site...

toomanyknots:

So if I want to attempt to redo my entire site, but I want to import my current products and categories, how should I go about it?
Make a backup:
a) all the PHP files
b) and your MySQL database

See: http://www.zen-cart.com/content.php?144-how-can-i-do-a-site-backup

8 Sep 2017, 12:48 AM
#16
happymom avatar

happymom

New Zenner

Join Date:
May 2006
Posts:
82
Plugin Contributions:
0

Re: Help diagnosing extremly slow loading site...

My site was good for several years and all of the sudden it got very very very slow. I looked everywhere in this forum but did not find anything to resolve my issue. Well, I resolve the issue and just wanted to posted here how i was able to troubleshoot it in case someone else has the same problem.

These are the symptoms:
store is very very very slow, but other portion of the website: forum, gallery, blog, FAQ were OK/fast/normal
Nothing was change on the code when the site displayed the slowness

It turned out to be that a third party java script (external to my site) that was required for one of the plugins that I had installed months ago, stop working.
The plug in was added to the header, so every time any page was loaded, it keep on waiting for the java script to complete, but it will never complete. So the rest of the page loading was on hold until it resolved to a failure.

To find the bad plugin:
use Chrome to open your site.
On the Chrome browser, select "More Tools" -> "Developer Tools"
On the Developer Tools Window, click on "Network"
Click on something on your web page.
The bad plugin will show in Red and as a failure.
Use your Zen Cart Admin: "Admin->Tools->Developers Took Kit-> Under Look up all files: enter the name of the plug in . Select "All Files Look up". Then click on Search.

This will show you where exactly the dead plugin is on your store. I just removed it and the site went back to its normal loading speed.