• Hello,

    I have a site that gets a lot of traffic (nearing 2 million hits per month). During peak times, the site will run for about an hour before the load on the server spikes up and so far the only thing that will revive the server is restarting mysqld. The site is on a powerful server (High-CPU Extra Large Instance), and the server it was previously on was smaller but handled the traffic with ease.

    I continually see slow queries — they appear to be indexed properly:

    # Query_time: 9  Lock_time: 0  Rows_sent: 10  Rows_examined: 69658
    SELECT SQL_CALC_FOUND_ROWS distinct wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.ID NOT IN ( SELECT tr.object_id FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy = 'category' AND tt.term_id IN ('24', '59', '2115', '2116', '2117') ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 10;

    What’s causing these queries?

    I’m not sure if these kind of slow queries are normal for WordPress, or if there’s optimization needed around this area. We’ve turned on caching (wp supercache and memcache). Any tips on what to try next is appreciated.

    Thanks,

    Sean

  • The topic ‘Slow Query — what is it? (or optimizing a high traffic site)’ is closed to new replies.