Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26
  1. #11
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: MySQL bottlneck - getting mysql errors

    i certainly appreciate your responses and help!!

    i understand we are on a dedicated server (does that share resources with the masses?). I do know, however, we share the resources with our forum and gallery.

    Quote Originally Posted by Website Rob View Post
    When you say "our Server loads" does this mean you have your own Server?

    Yes - then more / better optimization needs to be done at the Server level

    No - then probably time to get your own Server

    A 500 MB database is HUGE and, if the above load stats are from a busy Shared Server and are continually at that level, your site will never get past the problems it has now.

  2. #12
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: MySQL bottlneck - getting mysql errors

    crud... forgot to ask this, too...

    Do you have suggestions for better optimization for ZenCart.

    And, are there any versions of mySQL and/or PHP that they recommend NOT using?

  3. #13
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: MySQL bottlneck - getting mysql errors

    crud... forgot to ask this, too...

    Do you have suggestions for better optimization for ZenCart.

    And, are there any versions of mySQL and/or PHP that they recommend NOT using?
    Not better optimization of Zen Cart - more to optimizing your server LAMP settings and these are not something many will share as hours upon hours are spent in finetuning these settings.

    Question: DB is 500MB?? How many products do you have?
    Zen-Venom Get Bitten

  4. #14
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: MySQL bottlneck - getting mysql errors

    about 7400... mainly downloadables (which means at least one attribute on each one)

    has anyone seen a zen cart database larger than this? how far can it be pushed!

    Quote Originally Posted by kobra View Post
    Not better optimization of Zen Cart - more to optimizing your server LAMP settings and these are not something many will share as hours upon hours are spent in finetuning these settings.

    Question: DB is 500MB?? How many products do you have?

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

    Default Re: MySQL bottlneck - getting mysql errors

    Have you enabled Email Archiving? If so, why? You should probably trim it down if you plan to keep it enabled.
    Do you clear your Admin Activity Log regularly?
    Naturally, make backups before you go deleting any information.


    I've seen several databases larger than 500 MB, and they operate just fine.

    Your performance issues are more likely related to your server's general configuration than to the size of the database. Having such high sustained load-averages is going to slow everything down.

    Tuning your MySQL settings may help, but your load averages should be dealt with first.
    .

    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. #16
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: MySQL bottlneck - getting mysql errors

    The email archive table is empty .. and we clean admin when the site flags us at the top in the admin area... so both good things.

    Quote Originally Posted by DrByte View Post
    Have you enabled Email Archiving? If so, why? You should probably trim it down if you plan to keep it enabled.
    Do you clear your Admin Activity Log regularly?
    Naturally, make backups before you go deleting any information.


    I've seen several databases larger than 500 MB, and they operate just fine.

    Your performance issues are more likely related to your server's general configuration than to the size of the database. Having such high sustained load-averages is going to slow everything down.

    Tuning your MySQL settings may help, but your load averages should be dealt with first.

  7. #17
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: MySQL bottlneck - getting mysql errors

    Here is a common error we are getting... along with others... but i have seen this one several times or more

    2006 MySQL server has gone away in:
    [select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from zen_currencies]

    Thoughts?

    We are looking at a server upgrade and will do that soon. But, why do we continue to get errors??

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

    Default Re: MySQL bottlneck - getting mysql errors

    Quote Originally Posted by ksoup View Post
    2006 MySQL server has gone away
    This is a result of several things:

    1. A database connection was opened, but not closed, because there is intention to use it again.
    2. Then the program goes off and does some processing or talks to other servers, etc.
    3. Then it comes back and attempts to access the database again, but the processing in the previous step has taken longer than the timeout allowed by the server's configuration settings. Thus, since the server has closed the database connection, the program is not able to access it (since it had a reasonable expectation to be able to reach it again).

    Some timeout problems can occur when attempting to open the Checkout-Shipping page and perhaps the real-time quote query from USPS takes to long (such as their servers are taking a long time to respond, are down, etc), and when the program attempts to process the rest of the page logic, the database is no longer disconnected.

    But generally speaking, unless there is some sort of attempt to talk to an external resource or you have some sort of intense processing with custom code, there should be no reason for any database timeouts ... unless the problem is related to your server/database-server configuration.
    .

    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.

  9. #19
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: MySQL bottlneck - getting mysql errors

    Depending upon your Server Hardware specs, optimizing your current setup may get you better results.

    For example, in the Server 'php.ini' file the following should be used:

    [MySQL]
    ; Allow or prevent persistent links.
    mysql.allow_persistent = OFF

    That will help to prevent the situation as described by DrByte; which is also known as an "Orphan process".

  10. #20
    Join Date
    Jan 2008
    Posts
    7
    Plugin Contributions
    0

    Idea or Suggestion Re: MySQL bottlneck - getting mysql errors

    Don’t overlook the possibility of just plain bad SQL coding, especially if you’ve customized anything. Zen Cart’s SQL through 1.3.x is pretty darned inefficient with its SQL anyway (they’re fixing much of that in 1.4.x, currently in beta — around 700 queries removed in the generation of the Home Page alone!). When customizing ad-hoc SQL queries pieced together from variables and named constants and string constants and expressions and the like, a typo can easily be overlooked.

    We just had this problem with constantly getting “2008 MySQL client ran out of memory” errors on the products listings pages (“?main_page=index…”). After reading this thread and worrying about indices and MySQL and Apache config. parameters and our shared hosting service not being able to handle the load, etc., I finally simply pasted the query as shown on the error page into a phpMySQLadmin SQL window and executed it.

    It returned well over seven million records, from one of the smaller categories! This, mind you, for a store with only about 1,600 items, only about 20 of which were in that category!

    In analyzing the, I found some embarrassing typos on my part: in my customized “{store root}/includes/index_filters/default.filter.php” file, I had used the same alias on both sides of the “=” in my custom “LEFT JOIN … ON … =”s! I had, for instance (bad table alias capitalized here to call attention to it, but not of course capitalized in the original PHP code):
    PHP Code:
    $listing_sql "select … left join " TABLE_PRODUCTS_MYTYPE_EXTRA " x on p.products_id = x.products_id
        left join " 
    TABLE_MY_FILTER " f on x.myfilter_id = X.myfilter_id," 
    when it should’ve been
    PHP Code:
    $listing_sql "select … left join " TABLE_PRODUCTS_MYTYPE_EXTRA " x on p.products_id = x.products_id
        left join " 
    TABLE_MY_FILTER " f on x.myfilter_id = F.myfilter_id," 
    in all four times that that query appears (in various variants) in default_filter.php! Since I had more than one such custom filter, and all had that same typo (gah!), well, you can imagine why it returned so many records!

    Fixing that brought the results down to a far more manageable mere several thousand, which no longer crashed, but which still returned way too many records and was showing duplicate products in the listing — better than an error message, perhaps, but still not good.

    This time, the fault seemed to be in part of the original SQL query of the default_filter.php file! Maybe my custom product types and filters showed it up, but it seems to have been bad code all along, even in the default!

    It has to do with the Manufacturers portion of the query (so if your store doesn’t use Manufacturers, this probably wouldn’t affect you, but you should still consider fixing it in case you do start using Manufacturers in the future).

    Again, look for where the variable “$listing_sql” is assigned (it’s assigned four times, one of which will be executed based on various conditionals). In all four places, the table whose name is stored in the constant “TABLE_MANUFACTURERS” with alias “m” is listed as a cross join rather than a left or inner join! In all but the last one, this is mitigated by adding this conditional in the WHERE clause: “…and p.manufacturers_id = m.manufacturers.id” and so shouldn’t actually cause that problem unless the last one is executed.

    It’s referenced right after “TABLE_PRODUCTS_DESCRIPTION” which is also listed as a cross join, but that one with good reason: the “languages_id” field of the “zen_products_description” table means that that is a many-to-one relation with the “zen_products” table and so needs to be filtered separately for current language.

    I went ahead and reworded the query to make the TABLE_MANUFACTURERS referenced as a “LEFT JOIN ON p.manufacturers_id = m.manufacturers.id” in all four variants of the query, and removed the now-redundant “…and p.manufacturers_id = m.manufacturers.id” from the WHERE clause. To make the syntax cleaner, I moved it above the TABLE_PRODUCTS_DESCRIPTION reference.

    Now my products index listing pages return no out-of-memory errors, and return just what they’re supposed to! And, they’re quite a bit faster, to boot!

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. mysql errors
    By kitcorsa in forum Upgrading from 1.3.x to 1.3.9
    Replies: 11
    Last Post: 6 Jul 2010, 10:59 AM
  2. MYSQL Upgrade, now getting errors on mods
    By netchaos in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 10:19 PM
  3. running 1.3.0 MySQL Database errors
    By Noella in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 15 Sep 2006, 06:34 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