Forums / General Questions / Product Pages Much Slower Than Rest of Site

Product Pages Much Slower Than Rest of Site

Views: 620

Results 1 to 6 of 6
30 Aug 2011, 3:25 PM
#1
deepfrydaniel avatar

deepfrydaniel

New Zenner

Join Date:
May 2007
Posts:
29
Plugin Contributions:
0

Product Pages Much Slower Than Rest of Site

My store is at:

http://www.sorrystaterecords.com

I currently have the store set to display the page parse time. The index page generally parses in a second or less, category pages in about a second, EZ pages about the same, etc.

However, the individual product pages are REALLY slow... generally 5-8 seconds.

I have updated all of the settings to optimize performance as listed on the Zen Cart site and I have read through this thread:

https://www.zen-cart.com/forum/showthread.php?t=182360

And still can't get it to load quickly. Query time is generally well under a second, so why is the page taking so long to render?

The only thing I've found that might make a difference is that there are about 2,000 images in my product images folder (mostly images from old, deleted products). Could this slow down the product page that much?

30 Aug 2011, 4:53 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Product Pages Much Slower Than Rest of Site

Don't know if would affect the product info page, but I'm seeing a SQL error message at the bottom of your product listings.

30 Aug 2011, 5:14 PM
#3
deepfrydaniel avatar

deepfrydaniel

New Zenner

Join Date:
May 2007
Posts:
29
Plugin Contributions:
0

Re: Product Pages Much Slower Than Rest of Site

I see a SQL error at the bottom of some of the category listings pages, but I can't get any to show up on any individual Product Info pages. If you can point me toward one that would be helpful.

Just had a product page take 62.969 seconds to parse! Argh! This is unreasonable!

3 Sep 2011, 6:21 PM
#4
deepfrydaniel avatar

deepfrydaniel

New Zenner

Join Date:
May 2007
Posts:
29
Plugin Contributions:
0

Re: Product Pages Much Slower Than Rest of Site

Update on this... my host sent me these logs that show the queries on product pages taking 4-10 seconds... something is obviously wrong with these, as the index page and category pages make similar queries (or even more / larger queries) and generally execute in a fraction of a second.

===========================

Time: 100401 17:39:47

User@Host: deepfry_daniel[deepfry_daniel] @ localhost []

Query_time: 8 Lock_time: 0 Rows_sent: 149 Rows_examined: 1355439

use deepfry_zennew;
SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM zen_
customers c LEFT JOIN zen_orders o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL;

Time: 100408 20:10:37

User@Host: deepfry_daniel[deepfry_daniel] @ localhost []

Query_time: 4 Lock_time: 0 Rows_sent: 10 Rows_examined: 1611

use deepfry_zennew;
SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price,^M
p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model,^M
p.products_quantity, p.products_weight, p.product_is_call,^M
p.product_is_always_free_shipping, p.products_qty_box_status,^M
p.master_categories_id^M
FROM zen_products p^M
LEFT JOIN zen_manufacturers m^M
ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd^M
WHERE p.products_status = 1^M
AND p.products_id = pd.products_id^M
AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name limit 20, 10;

Time: 100410 5:49:04

User@Host: deepfry_daniel[deepfry_daniel] @ localhost []

Query_time: 10 Lock_time: 0 Rows_sent: 148 Rows_examined: 1409748

use deepfry_zennew;
SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM zen_
customers c LEFT JOIN zen_orders o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL;
=========================Does anyone have any ideas? Judging by the number of forum posts about slow product pages this is clearly a bug with zencart, and one I haven't seen solved adequately.

3 Sep 2011, 7:35 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Product Pages Much Slower Than Rest of Site

deepfrydaniel:

I currently have the store set to display the page parse time. The index page generally parses in a second or less, category pages in about a second, EZ pages about the same, etc.

However, the individual product pages are REALLY slow... generally 5-8 seconds.I've just clicked through about 100 products, and I'm getting the following:
Parse Time: 2.284 - Number of Queries: 88 - Query Time: 0.0509565103149
Parse Time: 2.944 - Number of Queries: 94 - Query Time: 0.0576473399963
Parse Time: 2.480 - Number of Queries: 98 - Query Time: 0.0749622143707
Parse Time: 2.408 - Number of Queries: 98 - Query Time: 0.0780691217804
Parse Time: 6.615 - Number of Queries: 98 - Query Time: 0.0890926534882
Parse Time: 3.240 - Number of Queries: 98 - Query Time: 0.0886883344269
Parse Time: 2.949 - Number of Queries: 98 - Query Time: 0.0633110088043
Parse Time: 3.155 - Number of Queries: 100 - Query Time: 0.147603789429
Parse Time: 2.457 - Number of Queries: 98 - Query Time: 0.0772628553009
Parse Time: 3.676 - Number of Queries: 98 - Query Time: 0.0669450330048
Parse Time: 2.373 - Number of Queries: 86 - Query Time: 0.0365003334656
Parse Time: 2.475 - Number of Queries: 86 - Query Time: 0.0511396939545
Parse Time: 3.576 - Number of Queries: 98 - Query Time: 0.0528762222595
Parse Time: 2.322 - Number of Queries: 86 - Query Time: 0.045493946106

From that it appears you've pared down unnecessary steps which has minimized queries, which is good. Also, your database is running very fast. But the bottleneck is the server's CPU for processing the logic to build the pages based on the data pulled from the database.
Even 2+ seconds is very long for processing such a simple bit of data for your pages.

deepfrydaniel:

Query time is generally well under a second, so why is the page taking so long to render?I can't find one that's performing poorly, so very hard to help specifically.
Maybe your specific product has an odd image filename specified for it? Maybe it's got some other bad data in the product's record?

deepfrydaniel:

The only thing I've found that might make a difference is that there are about 2,000 images in my product images folder (mostly images from old, deleted products). Could this slow down the product page that much?Well, it can cause a slowdown, for sure, since it will parse every filename found there. Always best to delete obsolete files such as images and backup .php files.

deepfrydaniel:

I see a SQL error at the bottom of some of the category listings pages That appears to be coming from a poorly-written addon which hasn't figured out how to properly prepare a list of product ids to pass into the query as search criteria ... at the very least it's got apostrophe and parenthesis backwards, and needs its nesting rearranged much smarter.
deepfrydaniel:

Just had a product page take 62.969 seconds to parse! Argh! This is unreasonable!Yes, that's unreasonable, but unless you post the parse time information including the query time, it's very difficult to help you.
And, since I've not been able to stumble upon that one by clicking around your store, perhaps you could point out which specific product you're referring to?

deepfrydaniel:

Update on this... my host sent me these logs that show the queries on product pages taking 4-10 seconds... something is obviously wrong with these, as the index page and category pages make similar queries (or even more / larger queries) and generally execute in a fraction of a second.The first and third of those queries is triggered by your admin when looking for customers who have not placed orders. That's a very specific lookup, which only occurs on pages where you're attempting to send certain emails from the admin side.

The second query you mentioned is a product-listing page query, not a product-info page query, so is not related to the problem at hand.

deepfrydaniel:

Judging by the number of forum posts about slow product pages this is clearly a bug with zencart, and one I haven't seen solved adequately.Most of the time those problems are caused by the hosting server and/or addons, or extraneous files left around on the server. Not sure how that's a ZC "bug" per se.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Sep 2011, 2:06 AM
#6
deepfrydaniel avatar

deepfrydaniel

New Zenner

Join Date:
May 2007
Posts:
29
Plugin Contributions:
0

Re: Product Pages Much Slower Than Rest of Site

Thanks so much for all your help.

Since I made the post I did a fresh install of the latest version of zencart. The only add-on installed is the SQL Query Cache addon, which is why the product pages are now around 2 seconds instead of double that.

The problem, by the way, is with the product pages in general... there aren't particular products that take longer, random pages just sometimes take a really long time for some reason.

I still don't understand why the index, admin, category listing, and other pages are so fast when they are making the same sorts of queries. 2 seconds is still too long for the product info pages when the other pages load in well under a second. I think it must be some type of problem with the product info page... like I said, this is a clean install with only the SQL Query Cache addon.