Jump to content

CubeCart lagging/not loading when viewing certain product/categories


CHGTF

Recommended Posts

Hello,

So recently within about the last week or two every time I attempt to view product for several specific categories through the CubeCart admin panel in V5.2.14 it takes a really long time to load the products. Sometimes it does not load at all. It is only for about 3 or 4 of the approx. 30+ specific categories I have on the site.

I have tried closing everything but the one web page displaying the admin window and even restarting my computer. However my computer will run everything else just fine. I do not experience this in any other program or web page. Also all the other product categories work just fine.

 

Why do these few categories not load properly in the admin page? Has anyone had this happen to them?

 

NOTE: I did not change anything dramatically to the site or to the admin window. The only thing I have actually done is update a few products here and there. (Only a few have been in the categories with issues) And I deleted a user from the "Settings - Administrators" selection a few days ago. But other than that I have done nothing else.

Link to comment
Share on other sites

We would ask that you enable debugging (Store Settings, Advanced tab) and add your own IP address (www.whatismyip.com).

 

When/if you get a page display for a product in a troublesome category, at the bottom of the display will be a grey area.

 

In this area, you will see SQL queries:

MySQLi
Queries (35):
[1] SELECT SQL_CALC_FOUND_ROWS * FROM `CubeCart_sessions` WHERE CubeCart_sessions.session_id = 'sridrukscqe1vohr5fmvakl3s3' LIMIT 1; -- (0 sec) [FROM CACHE]
[2] SELECT FOUND_ROWS() as Count; -- (0 sec)
[3] SELECT * FROM `CubeCart_lang_strings` WHERE CubeCart_lang_strings.language = 'en-US' ; -- (0.031199932098389 sec)
...etc.

Find the query or queries that may last a relatively long time.

 

At the bottom is the overall "Page Load Time". I do not know what this actually measures because in many cases for me, I get a negative number.

Link to comment
Share on other sites

These are the last few lines of the information given:

-------------------------------------

 

CubeCart_option_matrix.status = '1' LIMIT 1; -- (0.000131845474243 sec) [CACHED]
[1277] SELECT FOUND_ROWS() as Count; -- (7.39097595215E-5 sec)
[1278] SELECT `cat_id` FROM `CubeCart_category_index` WHERE CubeCart_category_index.primary = '1' AND CubeCart_category_index.product_id = '1984' ; -- (0.000137090682983 sec) [CACHED]
[1279] SELECT file_id FROM `CubeCart_image_index` WHERE CubeCart_image_index.product_id = '1984' AND CubeCart_image_index.main_img = '1' ; -- (0.000133991241455 sec) [CACHED]
[1280] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1815' ; -- (0.000148057937622 sec) [CACHED]
[1281] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1815' ; -- (0.000168085098267 sec) [CACHED]
[1282] SELECT `language`, `translation_id` FROM `CubeCart_inventory_language` WHERE CubeCart_inventory_language.product_id = '1984' ; -- (9.08374786377E-5 sec) [CACHED]
[1283] SELECT SQL_CALC_FOUND_ROWS MAX(stock_level) AS max_stock, MIN(stock_level) AS min_stock FROM `CubeCart_option_matrix` WHERE CubeCart_option_matrix.product_id = '1985' AND CubeCart_option_matrix.use_stock = '1' AND CubeCart_option_matrix.status = '1' LIMIT 1; -- (0.0001220703125 sec) [CACHED]
[1284] SELECT FOUND_ROWS() as Count; -- (7.20024108887E-5 sec)
[1285] SELECT `cat_id` FROM `CubeCart_category_index` WHERE CubeCart_category_index.primary = '1' AND CubeCart_category_index.product_id = '1985' ; -- (0.000133037567139 sec) [CACHED]
[1286] SELECT file_id FROM `CubeCart_image_index` WHERE CubeCart_image_index.product_id = '1985' AND CubeCart_image_index.main_img = '1' ; -- (0.000151872634888 sec) [CACHED]
[1287] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1814' ; -- (0.000144004821777 sec) [CACHED]
[1288] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1814' ; -- (0.000147104263306 sec) [CACHED]
[1289] SELECT `language`, `translation_id` FROM `CubeCart_inventory_language` WHERE CubeCart_inventory_language.product_id = '1985' ; -- (9.51290130615E-5 sec) [CACHED]
Errors:
No Errors

Memory: Peak Usage / Max (%):
12.50MB / 128M (9.77%)

Cache (None):
Cache is disabled [Clear Cache]

Page Load Time:
0.483226 seconds

 

------------------------

I see this "Page Load Time: 0.483226 seconds" - And I call BS - this page took more then 30 seconds to load.

 

I also see that there is some numbers similar to this:

Example:  -- (9.51290130615E-5 sec) [CACHED]

 

Does this mean 9.5 second essentially?  Or no?

 

I wonder because those largre (or large looking to me) numbers appear alot through out the 1200 + lines. However if they are actual load times that would mean this page would take a very tong time to load I would presume.


NOTE: This "freezing" or slow load time only happens when I attempt to "View All" in a specific category in Cube Cart.

Link to comment
Share on other sites

9.51290130615E-5 sec is in "scientific notation". You may have learned this in secondary school. It is a number with 4 zeros in front of 95etc -- .000095 or 95uS -- a very short time.

 

Query times are reasonable, but 1300 queries is not. Unless, as you say, page=all gets you hundreds of products.

 

The [CACHED] is misleading. I have been told there is a better indicator, due for the next release, for whether the query came from the database or a text file, cached locally, of a previous identical successful query.

 

Also, I think PHP does not keep the clock running when waiting for results from resources outside itself. But I may be wrong based on how CubeCart manages the clock.

 

I also think 0.5 seconds is reasonable. You must realize that this is the time CubeCart took to collect the data, populate a skin template, and have Smarty render the final page.

 

What cannot be revealed is how long the web server of your hosting provider takes to receive the data stream from PHP, compress it (if the server is configured to do so), and shove it down the Internet wires. And how fast your ISP can shove it to your house. But if you have no concerns about this aspect of page delivery, then we can certainly look at CubeCart again.

 

I notice: Cache is disabled. In Store Settings, Advanced tab, please enable cache. I would like to see what difference that makes.

 

I have also personally verified that Smarty, the template engine, takes a ridiculous amount of time to render a page. It has its own caching algorithm, but if caching is disabled, templates are compiled every time.

Link to comment
Share on other sites

New Info:

------------------------------------

CubeCart_option_matrix.status = '1' LIMIT 1; -- (0.00015115737915 sec) [CACHED]
[922] SELECT FOUND_ROWS() as Count; -- (0.000102043151855 sec)
[923] SELECT `cat_id` FROM `CubeCart_category_index` WHERE CubeCart_category_index.primary = '1' AND CubeCart_category_index.product_id = '1984' ; -- (0.000189065933228 sec) [CACHED]
[924] SELECT file_id FROM `CubeCart_image_index` WHERE CubeCart_image_index.product_id = '1984' AND CubeCart_image_index.main_img = '1' ; -- (0.000169992446899 sec) [CACHED]
[925] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1815' ; -- (0.000186204910278 sec) [CACHED]
[926] SELECT `language`, `translation_id` FROM `CubeCart_inventory_language` WHERE CubeCart_inventory_language.product_id = '1984' ; -- (0.000115871429443 sec) [CACHED]
[927] SELECT SQL_CALC_FOUND_ROWS MAX(stock_level) AS max_stock, MIN(stock_level) AS min_stock FROM `CubeCart_option_matrix` WHERE CubeCart_option_matrix.product_id = '1985' AND CubeCart_option_matrix.use_stock = '1' AND CubeCart_option_matrix.status = '1' LIMIT 1; -- (0.000149011611938 sec) [CACHED]
[928] SELECT FOUND_ROWS() as Count; -- (7.70092010498E-5 sec)
[929] SELECT `cat_id` FROM `CubeCart_category_index` WHERE CubeCart_category_index.primary = '1' AND CubeCart_category_index.product_id = '1985' ; -- (0.000186920166016 sec) [CACHED]
[930] SELECT file_id FROM `CubeCart_image_index` WHERE CubeCart_image_index.product_id = '1985' AND CubeCart_image_index.main_img = '1' ; -- (0.000174045562744 sec) [CACHED]
[931] SELECT * FROM `CubeCart_filemanager` WHERE CubeCart_filemanager.file_id = '1814' ; -- (0.00019097328186 sec) [CACHED]
[932] SELECT `language`, `translation_id` FROM `CubeCart_inventory_language` WHERE CubeCart_inventory_language.product_id = '1985' ; -- (0.000116109848022 sec) [CACHED]
Errors:
No Errors

Memory: Peak Usage / Max (%):
12.35MB / 128M (9.65%)

Cache (File):
Used: 1.60 MB [Clear Cache]

Page Load Time:
-0.486604 seconds

-----------------------------------

 

This time I used a stop watch and timed the load. Even missing the "start" button and starting approx. 3-5 seconds after I hit the "View All" button in the Product list - the time to load was still 21.4 seconds. This is actually pretty quick compared to other times. And sometimes it doesn't load at all.  

Query times are reasonable, but 1300 queries is not. Unless, as you say, page=all gets you hundreds of products.

The specific category at this time has 171 individual products in it. Some of these products need to be moved categories and that is why I have been working in the category specifically.

 

Query times are reasonable, but 1300 queries is not.

That is exactly what I was thinking. Not only that - now I only see 932 lines.

 

So basically is it just the hosting servers fault? If I remove more products - slowly - will it eventually get faster?

Link to comment
Share on other sites

In my experience, yes, CubeCart will get faster. You might be able to prove it to yourself.

 

Re-run setup (make a backup of the database just in case, and make a backup of /includes/global.inc.php) and specify a different table prefix. This will create the minimum, but separate database to run CubeCart.

 

There will only be one product and one category. When viewing the category, you can manually add &page=all to the URL. Thus, except for the number of products to list, CubeCart should be operating nearly identically to your actual store.

 

When finished experimenting, restore the globals.inc.php file to use the real database.

 

Personally, I think 171 products is not too many. A lot, yes, but not too many.

 

Here's another test: if you can do this with your browser, have your browser to not request any images. That is, if page=all gets 171 products, then the browser will fetch 171 images. (You haven't specified in your stopwatch experiment if you are including the time it took to fetch 171 images. And we are discussing the storefront??? Not an admin list??? I ask this because there is evidence in the debug that you are actually working in the admin Products, Filter by Category screen.)

 

If your browser has a "developer's console" and you can get a chart of network activity, you will be able to see how long the page request to page delivery took, plus how long it took for every page resource request: images, css, javascript. Firefox with the Firebug addon is great. I understand Chrome has some king of console with a Net tab.

 

For example, in an experiment I just now conducted, the initial HTML page load is 0.75 seconds. Then, fetching all the resources added another 2.75 seconds. And my server is sitting in the next room on a 1gig internal network.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...