Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jun 2009
    Posts
    187
    Plugin Contributions
    0

    Default Database queries took down host. Please help

    Sorry if this is in the wrong spot, but here is the email I got from the host and I'm not sure where to begin. Any help would be appreciated.

    > Something is wrong with your site. The following query is getting issued by your site every few seconds but requires more than 40 seconds to complete due to the tables involved and what appear to be a lack of good database indexes on the tables involved, causing it to run extremely slowly. There were hundreds of the queries built up and it ran the server out of connections.
    >
    > select distinct op.products_id,op.products_name , o.delivery_city , o.delivery_country
    > from orders o, orders_products op ,paypal p
    > where o.orders_id = op.orders_id
    > order by o.orders_id desc
    > limit 20

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

    Default Re: Database queries took down host. Please help

    Quote Originally Posted by linnx View Post
    > select distinct op.products_id,op.products_name , o.delivery_city , o.delivery_country
    > from orders o, orders_products op ,paypal p
    > where o.orders_id = op.orders_id
    > order by o.orders_id desc
    > limit 20
    I can't find that query anywhere in Zen Cart.
    It looks like maybe it's from a poorly-written addon you've installed?
    .

    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 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Database queries took down host. Please help

    I don't believe that this query is part of Zen Cart's core code either. I recommend using the Admin > Tools > Developer Toolkit to locate the following string "select distinct op.products_id," to see if this is part of an add-on mod or a hack.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #4
    Join Date
    Jun 2009
    Posts
    187
    Plugin Contributions
    0

    Default Re: Database queries took down host. Please help

    Ok thanks. We've disabled some "Popular Products, recently sold, modules." And the problem went away. What is strange is that it just happened today. Nothing has changed for the past year. Just kind of popped up.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Database queries took down host. Please help

    Quote Originally Posted by linnx View Post
    What is strange is that it just happened today. Nothing has changed for the past year. Just kind of popped up.
    "sudden" changes are always something to pay serious attention to.

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

    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.

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Database queries took down host. Please help

    Could you be more specific about the modules that you disabled? If the problem does lie with one or other of them, it would be helpful for other users to know.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jun 2009
    Posts
    187
    Plugin Contributions
    0

    Default Re: Database queries took down host. Please help

    Well we disabled all modules that may have caused it and the problem is still occurring. Did a search for "select distinct op.products_id," in developers tool kit and nothing came up.

    Is that query being issued in one of the php files?

  8. #8
    Join Date
    Jun 2009
    Posts
    187
    Plugin Contributions
    0

    Default Re: Database queries took down host. Please help

    If someone can offer guidance or would like to peak at the admin/ftp I can do that.

    thank you :)

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Database queries took down host. Please help

    Can't say where the query is coming from - it's not part of Zen Cart.

    It's badly-written, but that's not much of a clue. It might be part of a poorly-constructed mod - most problems like this are. Or it might be that you've been hacked and some php is being executed in a location that wouldn't normally have php, which could explain why the the developers toolbar doesn't find it. Or it could be instigated by somebody connecting directly to your database. There's no way to tell just by looking at the error message.

    If this were one of my clients sites I'd do a full file comparison against a fresh download of Zen Cart and ensure that I understood all the differences. Another approach would be to download the entire site and do a search for that query using a development IDE such as Dreamweaver, Eclipse or Aptana, unless your webhost offers an onserver search facility.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Jun 2009
    Posts
    187
    Plugin Contributions
    0

    Default Re: Database queries took down host. Please help

    I asked the host which files were doing that query and he said

    includes/modules/sideboxes/ezppt/recent_orders.php
    includes/modules/sideboxes/order_history.php

    How can I make it so those don't execute? I disabled everything in the side boxes controller. It is probably hard coded into one of the files.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 How to keep database queries down and store optimized.
    By sports guy in forum General Questions
    Replies: 2
    Last Post: 15 Apr 2015, 05:45 AM
  2. v139h Took over site, moving to another host, missing information to make this go smooth
    By Jeremiah H in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 10 Sep 2012, 08:08 PM
  3. v150 memeory problems took down my server - is it seo_cache?
    By milobloom in forum General Questions
    Replies: 2
    Last Post: 7 Sep 2012, 11:12 PM
  4. Doing a backup took over 7 hours - please help - [SSU]
    By nisdats in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 23 Jan 2010, 08:13 AM
  5. Replies: 5
    Last Post: 6 Sep 2006, 03:41 PM

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