Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Lack of indexing slowing cart (?) on Attributes (??)

Lack of indexing slowing cart (?) on Attributes (??)

Locked

Started by immunecology on 4 Apr 2007, 12:09 AM · Views: 3,507

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
4 Apr 2007, 12:09 AM
#1
immunecology avatar

immunecology

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Post #1 by immunecology

I have 10 products with 4 attributes each which I am using for display only.

The main problem is that the MySQL access is slowing the store to a halt.

Indications are that I do not have proper indexing or proper code to do MySQL access that takes advantage of the indexing.

There is a lot of talk about how fast ZenCart can be when well configured and a lot of talk about how slow it can get when not. I need specific answers, not just a suggestion to talk to my hosting service or 'check my indexing'. I've added indexes to tables and played with the cache, but nothing is working.

The site is delivering pages on the order of 7-8 seconds generally, but can go out to 50, 60, 70 seconds on occasion for no apparent reason.

If this is not a bug, I need to know what I have to fix to make the MySQL access reasonable.

Site store root:

http://www.immunecology.com/store/

Typical single product page results:

Parse Time: 16.838 - Number of Queries: 305 - Query Time: 0.233942500412
Parse Time: 15.381 - Number of Queries: 311 - Query Time: 0.750096514328
Parse Time: 16.380 - Number of Queries: 305 - Query Time: 0.240793095871

Occasionally:

Parse Time: 9.559 - Number of Queries: 309 - Query Time: 0.276353042328

Category page:

Parse Time: 12.011 - Number of Queries: 146 - Query Time: 0.256347579498

Simple pages that do not hit the SQL base leap into my browser in 2-3 seconds, depending upon graphics from the same server through the same connection.

Here are the specifics:

Server OS: Darwin 8.8.0
PHP Version: 4.4.2 (Zend: 1.3.0)
Database: MySQL 5.0.24a-standard
Zen Cart 1.3.7

I've already arrested the usual suspects.

Manufactures Sideox off
Category counts are off
Category counts in Admin are off
Images are optimized.
Gzip compression off so page starts to appear during rendering and does not wait

Session Cache is file based.

Cookie Domain True
Force Cookie Use True
Check SSL Session ID True
Check User Agent False
Check IP Address True
Prevent Spider Sessions False
Recreate Session True
IP to Host Conversion Status false

User Tracking Mod
Super Orders Mod
Admin Profiles Mod
Order Info Mod

There are some very interesting Red numbers on the Runtime
Information page for phpMyAdmin, followed by the error message/explaination

27 Slow_queries
27 Innodb_buffer_pool_reads
The number of logical reads that InnoDB could not satisfy from buffer
pool and had to do a single-page read.

791 k Handler_read_rnd
The number of requests to read a row based on a fixed position. This
is high if you are doing a lot of queries that require sorting of the
result. You probably have a lot of queries that require MySQL to scan
whole tables or you have joins that don't use keys properly.

69 M Handler_read_rnd_next <==!!!
The number of requests to read the next row in the data file. This is
high if you are doing a lot of table scans. Generally this suggests
that your tables are not properly indexed or that your queries are
not written to take advantage of the indexes you have.

2,023 Created_tmp_disk_tables

The number of temporary tables on disk created automatically by the
server while executing statements. If Created_tmp_disk_tables is big,
you may want to increase the tmp_table_size value to cause temporary
tables to be memory-based instead of disk-based.

450 Select_full_join
The number of joins that do not use indexes. If this value is not 0,
you should carefully check the indexes of your tables.

1,309 Opened_tables
The number of tables that have been opened. If opened tables is big,
your table cache value is probably too small.

-- Relevant Threads:

http://www.zen-cart.com/forum/showthread.php?t=15869

Linda says:

On my server I have sites with 1000-40,000+ products and 1,000-50,000 attributes with 50-70 attributes per product.

turns down SQL help and blames server configuration. What, specifically, constitutes a 'correct' server configuration? My host is willing to work with me, but his system is blazing fast for other apps.

There are lots of threads that discuss the issue and it seems that using attributes is potentially a factor, but I suspect it is poor table indexing in mods or the same in the ZenCart code itself.

If this is not a bug, then someone please help me resolve this issue.

I'll buy a cup of coffee to the zenner who knows how to make ZenCart run fast--which it apparently can--and can tell me.

Thanks in advance

Larry Lowe
https://www.immunecology.com

4 Apr 2007, 12:32 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

The same indexes on the:

On my server I have sites with 1000-40,000+ products and 1,000-50,000 attributes with 50-70 attributes per product.

Run your products with your 4 attributes ...

Unless you have removed all of your indexes or are missing them all ... this is a hosting issue and not a bug ...

The fact that the times slow down vs speed up indicate that the server is not optimized correctly for MySQL and php ...

Have you spoken to your host about these issues to see just how overloaded the server might be or if they could better optimize it?

I cannot see your site to test anything as you are Down for Maintenance at the moment ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 Apr 2007, 3:28 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #3 by ajeh

Looking at your site ... with 10 products ... there is no excuse for it being this slow ...

You can try turning on GZip in the Configuration ... GZip ... and see if this makes a radical difference ...

Otherwise, I cannot see any reason for this slowness other than poor server performance ... :(

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 Apr 2007, 4:19 AM
#4
immunecology avatar

immunecology

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Post #4 by immunecology

I have added some indexes and the site was down for maintainence. I think the MySQL got rebooted.

I had the Gzip turned off so that the user could see we are trying to build the page.

With the new indexes and a fresh reboot, it seems fairly quick now.

L.

4 Apr 2007, 4:44 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #5 by ajeh

A reboot masks a problem if over time ... hours or days ... this happens again ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 Apr 2007, 6:40 AM
#6
drbyte avatar

drbyte

Sensei

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

Post #6 by drbyte

immunecology:

Typical single product page results:

Parse Time: 16.838 - Number of Queries: 305 - Query Time: 0.233942500412
Parse Time: 15.381 - Number of Queries: 311 - Query Time: 0.750096514328
Parse Time: 16.380 - Number of Queries: 305 - Query Time: 0.240793095871

Occasionally:

Parse Time: 9.559 - Number of Queries: 309 - Query Time: 0.276353042328

Category page:

Parse Time: 12.011 - Number of Queries: 146 - Query Time: 0.256347579498

**Parse Time: **time it takes to process and render the page from start to finish, including queries and PHP and filesystem times. This includes reading all image files and calculating proper dimension settings if such function is enabled. This does not include transmission time from server to browser.

  • large images could slow this down
  • excessively busy disk drive could slow it down
  • low-RAM condition could slow it down
  • insufficient CPU for server busy-ness could slow it down

Number of Queries: number of requests to database for information

**Query Time: ** total amount of time spent in processing queries, including optimizing queries, reading indexes, extracting data, and returning data back to PHP for processing.

  • insufficient cache memory allocation in mysql configuration can slow this down, as well as other my.cnf configuration settings which need to be tuned specific to the individual server and its application
  • slow disk drives can slow it down
  • very busy database activity can slow it down

.
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.

8 Apr 2007, 10:36 PM
#7
jano avatar

jano

New Zenner

Join Date:
Nov 2005
Location:
California Los Angeles
Posts:
11
Plugin Contributions:
0

Post #7 by jano

I have not changed any configuration...
it is very slow, any ideas... thanks
here is the URL
https://secured.com/~f3668/lawofatt/

Thanks again

9 Apr 2007, 12:14 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #8 by ajeh

Might want to say it's about to roll over and play dead ... :eek:

You are on one very overloaded server or a server that was never intended to do anything other than HTML pages ...

I have to say that I have never seen a site this slow ...

I don't know why you have the whole site as secure either ... but that is not the cause here ...

Talk to your hosting site about putting you on a server that is not so overloaded ...

If they cannot, then I would suggest you look into our Certified Hosting sites from the Hosting link at the top of your screen ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2007, 12:26 AM
#9
immunecology avatar

immunecology

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Post #9 by immunecology

I added some indexes and the system (at Immunecology.com) has sped up somewhat, although the response of the MySQL remains the biggest part of the response time of a page.

My host has responded to my requirements by getting a faster hardware config together with more RAM--I understand my site will be one of the first moved over, which will help.

  • insufficient cache memory allocation in mysql configuration can slow this down, as well as other my.cnf configuration settings which need to be tuned specific to the individual server and its application

Can you elaborate specifics on which MySQL cache and table cache settings are critical and what kinds of settings should be in place?

One other problem that is of concern is a periodic loss of the MySQL socket that disconnects the database from the webserver. It may be related to the RAM settings or it may be an unrelated issue.

Has anyone ever faced that situation where the "Database Disconnected" page shows for any page requireing SQL? If so, what did they do about it?

And thanks to ZenCart for providing a graceful degradation in that event as I have a page in place to show the user rather than an error message.

9 Apr 2007, 12:30 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #10 by ajeh

I am not a server guru ... perhaps your hosting site can hire one of our Certified Hosting sites and have one of their gurus tell them how to properly setup their servers to work with MySQL and php ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

9 Apr 2007, 12:44 AM
#11
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Post #11 by merlinpa1969

Yes the DB disconnected is because you either have to many open connections or there is not enough memory to run the queries,

most likely a little of both

Zen cart PCI compliant Hosting

9 Apr 2007, 2:54 PM
#12
immunecology avatar

immunecology

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Post #12 by immunecology

Perhaps someone else here can recall a similar situation.

9 Apr 2007, 3:08 PM
#13
immunecology avatar

immunecology

New Zenner

Join Date:
Mar 2006
Posts:
25
Plugin Contributions:
0

Post #13 by immunecology

Merlinpa1969:

Yes the DB disconnected is because you either have to many open connections or there is not enough memory to run the queries,

most likely a little of both

Thanks, Merlin!

My previous reply was to the post before yours.

If anyone knows the kinds of cache values that are appropriate, I'd appreciate hearing about it.