Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default How to keep database queries down and store optimized.

    I have just installed Zen Cart v1.4 after an older stores database became very bogged down (11,000 queries and 8+ seconds for each product page load). After around 4 years of running.

    After installing a test product on the new site with the same exact attributes as my old site, now I am down to only 570 queries and 1.1 seconds. So I went from 11,000 queries per product pageload on old store to 571 on new store. Same attributes, and settings for attributes. I know this because under Configuration> Logging> Display The Page Parse Time set to true.

    Here is my concern: After 3 tests of the same exact product with no changes in my new store, it seems to add additional querries with each pageload. This is what I see:
    First page load test on new store - Number of Queries: 570 - Query Time: 0.612658459869
    Second page load - Number of Queries: 571 - Query Time: 0.642329505249
    Third page load - Number of Queries: 576

    As you can see every time a page refreshes or load it seems to add more queries to my database.

    I don't want this to build up to 11,000 queries like my other site. During setup I selected to add Cache to database to speed up large site. Is this the reason? And should I disable?

    How can I keep from adding lots of files and bloated files my database over time? And why is this adding a querry or a few each time I load a page?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: How to keep database queries down and store optimized.

    1. https://www.zen-cart.com/content.php...eed-up-my-site

    2. The increase is more likely coincidental than linear. There are randomizers used to allow featured/special/etc stuff to constantly be different on every refresh, and different products trigger different queries based on how you've configured each of them (downloads, special pricing, attributes, category structure, etc). A small fluctuation between refreshes isn't surprising.

    3. The "database cache" will put a small load on the database, but minimal. You could change it from 'database' to 'none' in both configure.php files if you like.

    4. The 11,000 issue is probably related to plugins/addons you've put on the site, or a difference in configurations of products/categories on that site. That number is extreme, and would require some careful investigation to determine what you've changed on the site's code to make that happen.

    See the link I posted in #1 for the main guidance we recommend considering.
    .

    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.

  3. #3
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: How to keep database queries down and store optimized.

    Thank you DrByte! All of your points are very helpful.

    Issue #4: This feedback is good to help me understand what went wrong. I though it was just age, but I noticed a slow down happened suddenly after adding new products (lots of them) and copying attributes. So it had to be something related to this. In the end, I think it also could have been related to the older dynamic price updater or me changing around the categories and products many times, but that is just a guess. That site took a long time to develop and enter all the attribute data. Now, I am rebuilding from scratch. But it will be nice to have a shiny new site that is quick again.

    This is information is good for me to know going forward. Especially since I have installed many Zen Cart sites that have been adding up and are now aging.

 

 

Similar Threads

  1. v150 Store Database Queries
    By hubert in forum Upgrading to 1.5.x
    Replies: 10
    Last Post: 4 Jun 2013, 01:35 AM
  2. v150 [Done v1.6.0] Store Database Queries
    By hubert in forum Bug Reports
    Replies: 0
    Last Post: 3 Jun 2013, 02:02 AM
  3. Database queries took down host. Please help
    By linnx in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 13 Aug 2009, 07:47 PM
  4. [Not a Bug] Logging :: Store Database Queries
    By shrimp-gumbo-mmmhhh in forum Bug Reports
    Replies: 4
    Last Post: 14 Aug 2008, 06:06 PM
  5. Store Database Queries?
    By SaveYourPhone in forum Basic Configuration
    Replies: 2
    Last Post: 18 Oct 2006, 05:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg