• Hi, i have a problem with my site

    It’s very slow, i contact with my datacenter and sent me this:

    Your server is overloaded because there are a lot of mysql queries which you can see below. The queries are no completing fast enough and overload entire server. As you can see there are queries which are running for 60-70 seconds which is unacceptable. Your developer need to check and optimize them.

    ——————————————–+
    | 2388 | user | localhost | blog | Sleep | 71 | | |
    | 2390 | user | localhost | blog | Sleep | 87 | | |
    | 2475 | user | localhost | blog | Sleep | 1 | | |
    | 2476 | user | localhost | blog | Sleep | 43 | | |
    | 2488 | user | localhost | blog | Sleep | 40 | | |
    | 2489 | user | localhost | blog | Sleep | 3 | | |
    | 2492 | user | localhost | blog | Sleep | 39 | | |
    | 2494 | user | localhost | blog | Query | 21 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2495 | user | localhost | blog | Sleep | 39 | | |
    | 2516 | user | localhost | blog | Query | 21 | Writing to net | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2517 | user | localhost | blog | Sleep | 29 | | |
    | 2518 | user | localhost | blog | Sleep | 1 | | |
    | 2519 | user | localhost | blog | Sleep | 28 | | |
    | 2524 | user | localhost | blog | Query | 19 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2525 | user | localhost | blog | Sleep | 21 | | |
    | 2529 | user | localhost | blog | Query | 17 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2530 | user | localhost | blog | Sleep | 19 | | |
    | 2533 | user | localhost | blog | Query | 11 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2534 | user | localhost | blog | Sleep | 13 | | |
    | 2535 | user | localhost | blog | Sleep | 3 | | |
    | 2536 | user | localhost | blog | Sleep | 12 | | |
    | 2540 | user | localhost | blog | Sleep | 0 | | |
    | 2541 | user | localhost | blog | Sleep | 9 | | |
    | 2542 | user | localhost | blog | Query | 4 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2543 | user | localhost | blog | Sleep | 7 | | |
    | 2544 | user | localhost | blog | Query | 3 | Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |
    | 2545 | user | localhost | blog | Sleep | 7 | | |
    | 2546 | user | localhost | blog | Sleep | 0 | | |
    | 2547 | user | localhost | blog | Sleep | 5 | | |
    | 2548 | user | localhost | blog | Query | 1 | Writing to net | UPDATE wp_options SET option_value = ‘a:8:{i:0;b:0;s:29:\”nextgen-gallery/nggallery.php\”;a:2:{i |
    | 2549 | user | localhost | blog | Sleep | 4 | | |
    | 2550 | user | localhost | blog | Query | 1 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts. |
    | 2551 | user | localhost | blog | Sleep | 0 | | |
    | 2552 | user | localhost | blog | Sleep | 4 | | |
    | 2553 | user | localhost | blog | Sleep | 1 | | |
    | 2555 | user | localhost | blog | Sleep | 1 | | |
    | 2556 | user | localhost | blog | Sleep | 2 | | |
    | 2557 | user | localhost | blog | Query | 0 | Sending data | SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘post’ AND |
    | 2558 | user | localhost | blog | Sleep | 0 | | |
    | 2559 | user | localhost | blog | Sleep | 0 | | |
    | 2560 | user | localhost | blog | Sleep | 0 | | |

    what can i do to fix the problem?

    Any help?

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thank you Chip. Here are the results:
    The page got an overall Page Speed Score of 78 (out of 100)

    High priority.
    Leverage browser caching, Combine images into CSS sprites

    Medium priority.
    Defer parsing of JavaScript, Minimize redirects, Specify a cache validator

    Low priority.
    Minify JavaScript, Minify CSS, Optimize images, Minify HTML, Optimize the order of styles and scripts, Serve scaled images, Put CSS in the document head, Remove query strings from static resources, Specify a Vary: Accept-Encoding header

    As you’re having a heavy WordPress site with many plugins on a dedicated server, it would be well worth the effort to optimize your server and analyze what exactly causes those queries that are inefficient.

    As a first step, benchmarking your site (or a copy of it) with the default theme and with all the plugins disabled should give you an idea of the difference your plugins and theme make, then you could enable them one by one and see how the performance is affected.

    As a reply to my earlier post, you wrote that you’re already using the W3 Total Cache plugin, but then you mention the WP Super Cache plugin in your list of plugins. If you had used one of these plugins first and then switched to the other one, you might need to check if it’s working properly.

    Thank you for your reply! I had W3 but after my reply I deactivated and activated the WP super cache. I have to admit that the site is more responsive now but there are still some hiccups! I need to locate the problem and eliminate it. Something causes these queries and let them stay alive and overload the server… please help me… I’ve moved to a bigger dedicated server from a vps to solve the problem but the problem persists. hence it’s not a problem with the server. It’s in the wordpress!

    Can anybody please help? I found out that when a new post is published then everything collapses and queries overload the entire server!

    If that helps, what still overloads the server is these:

    | 106066 | user | localhost | blog | Query | 6 |
    Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |

    | 106072 | user | localhost | blog | Query | 3 |
    Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |

    | 106073 | user | localhost | blog | Query | 2 |
    Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |

    | 106075 | user | localhost | blog | Query | 1 |
    Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |

    | 106076 | user | localhost | blog | Query | 1 |
    Copying to tmp table | SELECT wp_terms.slug, wp_posts.ID,
    wp_posts.post_name, wp_posts.post_title, wp_posts.post_author |

    | 106079 | user | localhost | blog | Sleep | 0 | |

    You should check your MySQL server configuration with a tool like mysqltuner.pl (https://mysqltuner.pl/) or tuning-primer.sh (https://forge.mysql.com/projects/project.php?id=44) to get an overview about your current configuration and some ideas for improvements.

    The queries you’ve shown here aren’t complete, so besides the fact that MySQL has to create a temporary table to execute them, there’s not much I can say. Try to determine which script causes these queries first, then you can debug it.

    I am having the very same issue with fatcow for my blog.
    The Nerdy Nurse

    It started happening randomly without me installing any new plugins or changing any code

    spbnepal

    (@spbnepal)

    I am in tension i am unable to fix the problem in https://basecamptrekking.com/ plz any one solve my problem

    But then gain no one actually has a solution?
    Wp is creating tmp tables causing the delay, the creation of these tables max out i/o disk and after a while the process remains running forever and oocks. i have a quadcore with 16G dedicated server. I guess this comes with using wordpress as a script??

    @pimpwise: As you’ve got plenty of RAM, you could look into moving the directory where MySQL stores its temporary tables to a “tmpfs” volume. This can make a big difference, as writing the temporary tables won’t hit the disk anymore.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘Too many SQL Queries – Extremely slow wordpress site’ is closed to new replies.