Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    May 2005
    Posts
    110
    Plugin Contributions
    0

    Default script causing cpu max limit - get_audiences_list()

    Hi,

    I recently updated our site from 1.3.7 to 1.3.8a and today noticed that both the 'Mail Gift Certificate' and 'Export Email Address' pages in the admin are causing my VPS server to crash - maxing out the CPU.

    When I view either of these pages in the admin they just wont load and then the whole admin being unresponsive after a minute or so due to my server CPU load going up to 97%.

    This has only occured since the upgrade and I cant find any threads of other people experiencing this? I am running a beefy VPS with MediaTemple which hasnt caused any dramas in the past and all is well until I go to one of these pages in the admin. have tested on our live store and development version, both installs have the same issue.

    Could it be something to do with get_audiences_list()?

    If someone could help that would be a great help and I am stuck on this with no real options.

    Brad.

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

    Default Re: script causing cpu max limit - get_audiences_list()

    That's from the new "Customers who have never placed an order" audience option added in 1.3.8.

    If your system can't handle it, run this query from Install SQL Patch or phpMyAdmin:
    Code:
    update query_builder set query_category = '' where query_name = 'Customers who have never completed a purchase';
    .

    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
    Jan 2006
    Posts
    117
    Plugin Contributions
    0

    Default Re: script causing cpu max limit - get_audiences_list()

    Just a note that it looks like this was the cause of the crashing of my database recently.

  4. #4
    Join Date
    May 2008
    Location
    United States
    Posts
    490
    Plugin Contributions
    1

    Default Re: script causing cpu max limit - get_audiences_list()

    I was having this same issue, page took forever to load. Found this and ran it...works perfect now! What did this patch do exactly?


    Quote Originally Posted by DrByte View Post
    That's from the new "Customers who have never placed an order" audience option added in 1.3.8.

    If your system can't handle it, run this query from Install SQL Patch or phpMyAdmin:
    Code:
    update query_builder set query_category = '' where query_name = 'Customers who have never completed a purchase';

  5. #5
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,246
    Plugin Contributions
    58

    Default Re: script causing cpu max limit - get_audiences_list()

    CONFIGURATION >> EMAIL OPTIONS >> Audience-Select Count Display

    Setting the above to false helps quite a bit also.

    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  6. #6
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: script causing cpu max limit - get_audiences_list()

    Quote Originally Posted by marcopolo View Post
    I was having this same issue, page took forever to load. Found this and ran it...works perfect now! What did this patch do exactly?
    I'd love to understand why this works too..

    I was getting the following error when ever I clicked on Admin > Gift Certificate/Coupons > Mail Gift Certificate, and I tried this little bit of SQL and lo and behold.. all is right with the world..

    Code:
    1104 The SELECT would examine more than MAX_JOIN_SIZE  rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=#  if the SELECT is okay
    in:
    [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  ]
    If you were entering information, press the BACK button in your browser and  re-check the information you had entered to be sure you left no blank  fields.
    
    

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

    Default Re: script causing cpu max limit - get_audiences_list()

    The query in question works fine on a small dataset, but in the case of large amounts of order and/or customer data the query is not adequately optimized. So, to keep it will require fine-tuning it.
    .

    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. #8
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: script causing cpu max limit - get_audiences_list()

    Quote Originally Posted by DrByte View Post
    The query in question works fine on a small dataset, but in the case of large amounts of order and/or customer data the query is not adequately optimized. So, to keep it will require fine-tuning it.
    So if I am understanding you correctly, as the database grows, I can possibly expect this to happen again.. Can you provide some insight that would help me understand how I go about fine tuning this query.. is what I need to do to prevent this from happening again??

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

    Default Re: script causing cpu max limit - get_audiences_list()

    As to "when" the problem would be triggered, I don't have a "magic number" to tell you when you'd experience problems with the size of the data. Frankly, when I added that query to the list for v1.3.8a after testing with several forum members, I didn't anticipate this problem. But ... sometimes things do happen unexpectedly. It's really not high on my list of priorities of things to "fix". If it causes a problem for you, simply disable it by making the change I posted earlier ... which will disable it so it won't show in selection lists and won't try to run the query.

    If you want to fine-tune the query, feel free to go study the ins and outs of mysql queries and joins and optimization ... dev.mysql.com And when you find the optimal revision for it, feel free to share it for consideration and testing by others.
    .

    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.

  10. #10
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: script causing cpu max limit - get_audiences_list()

    Quote Originally Posted by DrByte View Post
    As to "when" the problem would be triggered, I don't have a "magic number" to tell you when you'd experience problems with the size of the data. Frankly, when I added that query to the list for v1.3.8a after testing with several forum members, I didn't anticipate this problem. But ... sometimes things do happen unexpectedly. It's really not high on my list of priorities of things to "fix". If it causes a problem for you, simply disable it by making the change I posted earlier ... which will disable it so it won't show in selection lists and won't try to run the query.
    That answered my original question.. I was really trying to get more of a sense of why moreso than when the problem was triggered, but I think I get it now.. After talking it over with my client, she is okay with this group of customers being disabled.. So after running the change you posted, the error disappears, and so all is right in the world.. Thanks for your response..

    Quote Originally Posted by DrByte View Post
    If you want to fine-tune the query, feel free to go study the ins and outs of mysql queries and joins and optimization ... dev.mysql.com And when you find the optimal revision for it, feel free to share it for consideration and testing by others.
    Honestly I can do BASIC queries on my own, but joins and optimization is WAAAAAY over my head.. Disabling the query seems to be okay with her for now.. If my client really wants to push getting this fixed, we would likely be engaging the services of a contractor to help troubleshoot this.. If we do, and my client is okay with sharing the contractor's results, I'll be happy to share with the community..

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. USPS max weight limit
    By buildingblocks in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 15 Sep 2011, 05:01 PM
  2. max qty limit message not showing
    By jezjones29 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 Feb 2010, 11:03 AM
  3. Limit the max order total...?
    By LittleOleMeDesigns in forum Addon Shipping Modules
    Replies: 13
    Last Post: 13 Feb 2009, 07:45 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