Get the book

Go Back   Zen Cart Support > General Questions > General Questions

General Questions Questions that don't fit elsewhere

Reply
 
Thread Tools Display Modes
Old 30th June 2008, 05:43 AM   #1
emtecmedia
Zen Follower
 
Join Date: May 2005
Posts: 111
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.
emtecmedia is offline   Reply With Quote
Old 30th June 2008, 07:27 AM   #2
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,586
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!
DrByte is offline   Reply With Quote
Old 29th September 2008, 07:04 AM   #3
TheHYPO
Zen Follower
 
Join Date: Jan 2006
Posts: 109
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.
TheHYPO is offline   Reply With Quote
Old 5th February 2009, 02:11 AM   #4
marcopolo
Zen Follower
 
Join Date: May 2008
Posts: 127
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';
marcopolo is offline   Reply With Quote
Old 5th February 2009, 02:21 AM   #5
mprough
Totally Zenned
 
mprough's Avatar
 
Join Date: Nov 2007
Location: Mogadore, Ohio
Posts: 1,725
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. :: Recent Zen Cart Project :: Zen Cart SEO – 12 Steps to Success
**I answer questions in the forum, private messages are NOT answered.
mprough is offline   Reply With Quote
Old 19th August 2009, 06:00 AM   #6
DivaVocals
Totally Zenned
 
Join Date: Jan 2007
Location: La La Land Where the sun shines!
Posts: 1,188
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.

DivaVocals is offline   Reply With Quote
Old 19th August 2009, 06:07 AM   #7
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,586
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!
DrByte is offline   Reply With Quote
Old 19th August 2009, 02:54 PM   #8
DivaVocals
Totally Zenned
 
Join Date: Jan 2007
Location: La La Land Where the sun shines!
Posts: 1,188
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??
DivaVocals is offline   Reply With Quote
Old 19th August 2009, 08:02 PM   #9
DrByte
Sensei
 
DrByte's Avatar
 
Join Date: Jan 2004
Location: Ontario, Canada
Posts: 38,586
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!
DrByte is offline   Reply With Quote
Old 19th August 2009, 10:56 PM   #10
DivaVocals
Totally Zenned
 
Join Date: Jan 2007
Location: La La Land Where the sun shines!
Posts: 1,188
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..
DivaVocals is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is causing this? digidiva-kathy First Steps & General Customization Issues 1 30th November 2007 05:43 AM
Any idea what is causing this? digidiva-kathy First Steps & General Customization Issues 8 12th March 2007 02:21 PM
Premature end of script headers: php-script doubletiger General Questions 8 2nd July 2006 10:53 PM


All times are GMT +1. The time now is 01:25 AM.

Learn tips, tricks & secrets for your Zen Cart™
Sign up for our FREE Newsletter

Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content and Graphics Copyright (c) 2006, 2007, 2008, 2009 Zen Ventures, LLC - all rights reserved
Get Zen Cart E-Commerce Shopping Cart at SourceForge.net. Fast, secure and Free Open Source software downloads