Mobile app version of vmapp.org
Login or Join
Kaufman445

: Wordpress 3.3.1 mySQL very high CPU usage My host has given me this log and tells me its mySQL overloading my server: | 266976 | db_name | localhost | db_name | Query | 30

@Kaufman445

Posted in: #Mysql #Wordpress

My host has given me this log and tells me its mySQL overloading my server:

| 266976 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 266978 | db_name | localhost | db_name | Query | 29 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 266980 | db_name | localhost | db_name | Query | 45 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 266996 | db_name | localhost | db_name | Query | 43 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267002 | db_name | localhost | db_name | Query | 44 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267008 | db_name | localhost | db_name | Query | 10 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267011 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267013 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267016 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267018 | db_name | localhost | db_name | Query | 13 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267023 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267033 | db_name | localhost | db_name | Query | 44 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267034 | db_name | localhost | db_name | Query | 44 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267040 | db_name | localhost | db_name | Query | 43 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267041 | db_name | localhost | db_name | Query | 10 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267050 | db_name | localhost | db_name | Query | 42 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267058 | db_name | localhost | db_name | Query | 38 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267060 | db_name | localhost | db_name | Query | 29 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267062 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT p.* FROM wp2_posts AS p INNER JOIN wp2_term_relationships AS tr ON p.ID = tr.object_id INNER |
| 267072 | db_name | localhost | db_name | Query | 34 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267075 | db_name | localhost | db_name | Query | 34 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267076 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT p.* FROM wp2_posts AS p INNER JOIN wp2_term_relationships AS tr ON p.ID = tr.object_id INNER |
| 267084 | db_name | localhost | db_name | Query | 19 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267087 | shonline | localhost | shonline_sho2011 | Query | 15 | update | INSERT INTO accesslog (title, path, url, hostname, uid, sid, timer, timestamp) VALUES ('???? |
| 267088 | db_name | localhost | db_name | Query | 2 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |
| 267089 | db_name | localhost | db_name | Query | 30 | Copying to tmp table | SELECT SQL_CALC_FOUND_ROWS wp2_posts.* FROM wp2_posts INNER JOIN wp2_term_relationships ON (wp2_po |


The server is a Xeon quadcore, 4GB RAM, 2Mbit up and down bandwidth. Monthly 2 million visitors. Apache set to 500 concurrent and SQL set to 250.

Plugins:
Adrotate / Contact Form 7 / Disqus / Events / Jetpack / Really Simple Captcha / Use Google Libraries / WebsiteDefender / Wordpress.com Popular Posts / WP-Page Navi / WP-Print / WP-Minify / WP-Super Cache

How can I fix this?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

1 Comments

Sorted by latest first Latest Oldest Best

 

@Hamaas447

When you see Copying to tmp table, that's often a sign that you wrote a bad query that is going to take a long time to run. Your post is showing several that are taking 45 seconds or more to run. Identify what queries are running that are taking a long time.

You'll need to alter those queries to make proper use of indexes. That may require finding out which plugins are kicking them off.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme