Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm sure this topic has been discussed to death, but I figure each case can be relatively unique, so please hear me out.

The 'mysql' process currently sits at 150 CPU%. It does not budge (maybe ~1% here and there), even when there is little or no traffic. That said, I don't see how it could be query related. All queries are nicely indexed and execute in < ~1 second.

My server specs are as follows:

Dedicated Server Intel Xeon 3470+ (Quad Core) 8 Processors

8 GB DDR3 Memory

MySQL v5.1 - Apache/2.2.22 (Unix) - PHP 5.2.17

Current 'Load Averages' on the server are: ~2.5 ~2.5 ~2.5, but never reach higher, and usually average ~1.5 across the board.

Below is the my.cnf file for the server as it currently stands:

[mysqld] 
tmpdir=/tmp 
open_files_limit=33628 

#skip-innodb 
#innodb_file_per_table=1 
#innodb_file_format=barracuda 
#innodb_strict_mode=0 
#innodb_fast_shutdown=0 
#ignore-builtin-innodb 
#plugin-load=innodb=ha_innodb_plugin.so 

#ssl-cert=/var/cpanel/ssl/exim/exim.crt 
#ssl-key=/var/cpanel/ssl/exim/exim.key 

old_passwords=1 
datadir=/var/lib/mysql 
skip-locking 
safe-show-database 
tmp_table_size = 128M 
max_heap_table_size = 128M 
query_cache_limit=4M 
query_cache_size=256M ## 32MB for every 1GB of RAM 
query_cache_type=1 
max_connections=150 
collation_server=utf8_unicode_ci 
character_set_server=utf8 


delayed_insert_timeout=40 

interactive_timeout=10 
wait_timeout=3600 
connect_timeout=20 
thread_cache_size=128 
key_buffer=256M ## 32MB for every 1GB of RAM 
join_buffer=1M 
max_connect_errors=20 
max_allowed_packet=16M 
table_cache=8196 
record_buffer=1M 
sort_buffer_size=8M ## 1MB for every 1GB of RAM 
read_buffer_size=8M ## 1MB for every 1GB of RAM 
read_rnd_buffer_size=8M ## 1MB for every 1GB of RAM 
thread_concurrency=16 ## Number of CPUs x 2 
myisam_sort_buffer_size=32M 
server-id=1 

[mysql.server] 
user=mysql 


[safe_mysqld] 
open_files_limit=33628 
err-log=/var/log/mysqld.log 
pid-file=/var/lib/mysql/mysql.pid 

[mysqldump] 
quick 
max_allowed_packet=16M 

[mysql] 
no-auto-rehash

I have been battling this for ages, and am always down for giving things a shot for myself before asking for help. However, it seems I cannot get this one to cooperate.

Any and all help is greatly appreciated!

Regards,

Marc

---------- EDITED ------------

Linux Distribution: CentOS 5.8 (Final)

I do not believe mytop is isntalled. How would I go about installing that?

Below is SHOW PROCESSLIST;

+--------+---------------+-----------+------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| Id     | User          | Host      | db               | Command | Time | State          | Info                                                                                                 |
+--------+---------------+-----------+------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
| 594376 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    1 |                | NULL                                                                                                 |
| 594378 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594380 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Query   |    0 | Sorting result | SELECT
                                                                                `id`, `category`, `property_type`, `price`, `square_feet`, `year_built`, `bedrooms` |
| 594381 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Query   |    0 | Sorting result | SELECT
                                                        `id`,
                                                        `agent_id`,
                                                        `category`,
                                                        `property_type`,
                                                        `price`,
                 |
| 594382 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594384 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594385 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594386 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594388 | mrmarcus_jeff | localhost | mrmarcus_sandbox | Sleep   |    0 |                | NULL                                                                                                 |
| 594390 | root          | localhost | NULL             | Query   |    0 | NULL           | show processlist                                                                                     |
+--------+---------------+-----------+------------------+---------+------+----------------+------------------------------------------------------------------------------------------------------+
10 rows in set (0.00 sec)
share|improve this question
    
What does 'show processlist;' return? (As the mysql root user). Also, is this Linux, if so which distrib? Does it have 'mytop' in the distribution's package repository? –  EightBitTony May 10 '12 at 14:23
    
Hey there, EightBitTony. I've added some more information as per your request. Thanks for your time. –  user120636 May 10 '12 at 14:35
    
How is 150% CPU on an 8 core machine a problem? Do you have any cron jobs running? –  HTTP500 May 10 '12 at 14:40
    
Well, because it used to run at ~30% with some actual fluctuation. Now, it maintains ~180% steady (has gone up since I restored my.cnf to default settings). Doesn't move up, doesn't move down. Regardless of traffic. –  user120636 May 10 '12 at 14:48
    
There are some suggestions here - stackoverflow.com/questions/1282232/mysql-high-cpu-usage. No idea how to install mytop on Centos, I think it's just a set of perl scripts, just apt-get install on Debian. I would watch 'show processlist;' for a while and see if there's a lot of churn or anything obvious that jumps out. –  EightBitTony May 10 '12 at 14:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.