Forums

MySQL slow queries log (13 posts)

  1. chgeorge
    Member
    Posted 1 year ago #

    During the last 1-2 months I frequently get "Error establishing database connection" about 4-5 times every day. I use SuperCache and the number of plugins I use is small and never had a problem with them.

    So something has to do with the WordPress perhaps. I went to check the MySQL slow queries log and ALL of the logs are full with about the same thing:

    # Query_time: 1.171499 Lock_time: 0.000167 Rows_sent: 50 Rows_examined: 179433
    SELECT * FROM wp_comments c LEFT JOIN wp_posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT 58950, 50

    Now, what is that? Is this something normal? Or is there a way to fix it? Could this be the cause of the errorI get all the time?

  2. Jason
    Member
    Posted 1 year ago #

    You might try running an optimize and repair on your database using a plugin or phpmyadmin.

  3. chgeorge
    Member
    Posted 1 year ago #

    I've optimized it about 5-6 times last month, but the results stay the same.

  4. songdogtech
    Member
    Posted 1 year ago #

    How many posts/pages do you have? Cleaning out old post/page revisions can greatly reduce the size of your database and increase it's speed. Also, empty your trash and delete spam comments.

    Run as SQL query in phpmyadmin to delete post/page revisions. Backup your DB first.

    DELETE a,b,c
    FROM wp_posts a
    LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
    LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
    WHERE a.post_type = 'revision'

    You can add to wp-config.php to stop revisions and autosave:

    define ('WP_POST_REVISIONS', FALSE);
    define('AUTOSAVE_INTERVAL', 6000);

    Or select the number of revisions to keep:
    define('WP_POST_REVISIONS', 3);

  5. chgeorge
    Member
    Posted 1 year ago #

    I got 925 posts and 5 pages. Trash and Spam are always empty. I just checked that wassup plugin uses over than 2.5 million records. Could this be the problem? I deleted both the plugin and the table, I 'll tell you if this is going to work!

  6. chgeorge
    Member
    Posted 1 year ago #

    Well nothing happened, CPU throttling increases like devil (as traffic increases)... :(

  7. songdogtech
    Member
    Posted 1 year ago #

    I'd Clean Options « WordPress Plugins and be sure the wassup plugin is really gone.

  8. chgeorge
    Member
    Posted 1 year ago #

    Checked that wassup is fully gone, but same things again. CPU throttling goes like hell. And "error establishing database connection" appears 3-4 times every day, when there is much traffic. Any other idea? :(

  9. songdogtech
    Member
    Posted 1 year ago #

    "error establishing database connection" is the host database server going down. Who is your host? Might be better of finding another one.

  10. chgeorge
    Member
    Posted 1 year ago #

    It's hostmonster. Moving to another server costs money and time. And the result is not guaranteed...

  11. aftab1003
    Member
    Posted 1 year ago #

    having the same problem of cpu throttling about all the day 24hours. from hostmonster

    done several things but no results.

  12. Jefferiesdesign
    Member
    Posted 1 year ago #

    HAve a hostmonster account as well with the same random error.
    More often than not. Have to refresh many times before it shows.

    throttling of the server maybe?

    Has anyone resolved this with hostmonster aka bluehost yet?

    PLEASE RESPOND IF YOU HAVE!
    thanks!

  13. bh_WP_fan
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic