mysql using >100% cpu

bdj

Verified User
Joined
Feb 22, 2008
Messages
139
I'm running freebsd 6.1
dual core 2,33 ghz 4mb cache, 2gb RAM

For some reason mysql is using more than 100% cpu, is something wrong?


Code:
last pid: 12809;  load averages:  6.90,  5.38,  4.96                                    up 37+04:21:30  22:26:20
199 processes: 6 running, 193 sleeping
CPU states: 32.5% user,  0.0% nice, 67.1% system,  0.4% interrupt,  0.0% idle
Mem: 752M Active, 332M Inact, 247M Wired, 69M Cache, 112M Buf, 600M Free
Swap: 4068M Total, 4068M Free

  PID USERNAME   THR PRI NICE   SIZE    RES STATE  C   TIME    CPU COMMAND
12483 mysql       69  20    0   453M 84336K kserel 0  23:25 136.67% mysqld
12803 apache       1  20    0 36968K 30544K lockf  1   0:00  0.73% httpd
12741 apache       1  20    0 35808K 29352K lockf  1   0:00  0.39% httpd
  763 root         1   8    0   852K   280K nanslp 0   0:58  0.00% da-popb4smtp
  529 root         1  96    0  3640K  2088K select 1   0:38  0.00% sshd
94077 apache       1   4    0 37572K 30908K sbwait 1   0:30  0.00% httpd
95011 apache       1   4    0 37488K 30824K sbwait 0   0:29  0.00% httpd
93265 apache       1   4    0 37408K 30732K sbwait 0   0:29  0.00% httpd
96241 apache       1   4    0 37432K 30784K sbwait 0   0:28  0.00% httpd
94275 apache       1   4    0 37624K 30976K sbwait 1   0:28  0.00% httpd
94091 apache       1   4    0 37536K 30872K sbwait 0   0:28  0.00% httpd
94365 apache       1   4    0 37380K 30736K sbwait 1   0:28  0.00% httpd
94963 apache       1   4    0 37476K 30812K sbwait 0   0:28  0.00% httpd
95010 apache       1   4    0 37504K 30860K sbwait 1   0:28  0.00% httpd

i have thread_concurrency=4 in my.cnf
 
Last edited:

Rich-Boy

Verified User
Joined
Jan 24, 2006
Messages
223
How much is MYSQL being accessed by users? Take a look at the processes list inside phpmyadmin or install mytop [/usr/ports/databases/mytop]
Chances are the problem is more complex than this but it's a start.
 

bdj

Verified User
Joined
Feb 22, 2008
Messages
139
Hi,

thanks for the reply.

To inform other readers, i figured out that >100 cpu is possible. It's possible because of multi cores. Basicly 100% of the first core and the rest from the other core.

Second, i solved the problem but removing a large database which caused the massive cpu usage when more than 50 threads were connected.
 
Top