MySQL Forums
Forum List  »  Performance

Re: High CPU usage on mysql
Posted by: Rick James
Date: March 27, 2014 04:36PM

The SHOW STATUS is virtually useless, since it defaults to SESSION; do this instead:
SHOW GLOBAL STATUS;
SHOW VARIABLES;

High CPU is almost always caused by schema design, indexes, and/or query design. Let's see
EXPLAIN SELECT ... -- for the long running query;
SHOW CREATE TABLE -- for the table(s) in question

> key-buffer-size = 64M
> key_buffer_size = 2048M

Well, which is it? If you are using only MyISAM, change that to 600M; 64M is probably too small for the indexes you have; 2G is probably too big for your 4GB machine -- need to leave room over for non-index caching.

> which I've adjust the key_buffer_size to 2048M so it's greater than MyISAM index

That rule would be OK, if you had enough RAM; you don't.

It's [ code ], not < code > (BBCode).

Options: ReplyQuote


Subject
Views
Written By
Posted
6090
March 24, 2014 10:23AM
Re: High CPU usage on mysql
1674
March 27, 2014 04:36PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.