MySQL Comendo Uso da CPU (Urgente)

2

Recentemente, eu purgei os arquivos de cache para o meu site e agora o MySQL está consumindo CPU em até 100%. Ele cresce lentamente de 10% a 100% em 5min e o servidor trava. Felizmente, eu virei o serviço através de #service mysql stop , mas cada vez que eu o ligo, ele começa a comer a CPU.

Este é o log de erros:

#/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/dev.system.de.pid
101112 18:22:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101112 18:22:03 [Warning] option 'innodb-additional-mem-pool-size': signed value 204800 adjusted to 524288
101112 18:22:03 [Warning] option 'innodb-log-buffer-size': signed value 204800 adjusted to 262144
101112 18:22:03 [Note] Plugin 'ndbcluster' is disabled.
101112 18:22:03  InnoDB: Started; log sequence number 0 63198013
101112 18:22:03 [Note] Event Scheduler: Loaded 0 events
101112 18:22:03 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.50'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

Status information:

Current dir: /var/lib/mysql/
Running threads: 0  Stack size: 196608
Current locks:
lock: 0x89df8a0:

lock: 0x89d6798:

lock: 0x89cca68:

lock: 0x89c1500:

lock: 0x89b9818:

lock: 0x89adff8:

lock: 0x89a9918:

lock: 0x899b3e0:


Key caches:
default
Buffer_size:      33554432
Block_size:           1024
Division_limit:        100
Age_limit:             300
blocks used:             3
not flushed:             0
w_requests:              0
writes:                  0
r_requests:              6
reads:                   3


handler status:
read_key:            0
read_next:           3
read_rnd             0
read_first:          3
write:               0
delete               0
update:              0

Table status:
Opened tables:         15
Open tables:            8
Open files:            16
Open streams:           0

Alarm status:
Active alarms:   0
Max used alarms: 0
Next alarm time: 0

Begin safemalloc memory dump:

End safemalloc memory dump.

Memory status:
Non-mmapped space allocated from system: 1286144
Number of free chunks:                   19
Number of fastbin blocks:                0
Number of mmapped regions:               7
Space in mmapped regions:                108834816
Maximum total allocated space:           0
Space available in freed fastbin blocks: 0
Total allocated space:                   1242928
Total free space:                        43216
Top-most, releasable space:              25280
Estimated memory (with thread stack):    110120960

Events status:
LLA = Last Locked At  LUA = Last Unlocked At
WOC = Waiting On Condition  DL = Data Locked

Event scheduler status:
State      : INITIALIZED
Thread id  : 0
LLA        : n/a:0
LUA        : n/a:0
WOC        : NO
Workers    : 0
Executed   : 0
Data locked: NO

Event queue status:
Element count   : 0
Data locked     : NO
Attempting lock : NO
LLA             : init_queue:132
LUA             : init_queue:142
WOC             : NO
Next activation : never
101112 18:26:07 [Note] /usr/libexec/mysqld: Normal shutdown

101112 18:26:08 [Note] Event Scheduler: Purging the queue. 0 events
101112 18:26:08 [ERROR] /usr/libexec/mysqld: Sort aborted
101112 18:26:10  InnoDB: Starting shutdown...
101112 18:26:13  InnoDB: Shutdown completed; log sequence number 0 63198023
101112 18:26:13 [Note] /usr/libexec/mysqld: Shutdown complete

Desculpe, mas não sei ler isso. Alguém poderia ajudar?

    
por Gio Borje 13.11.2010 / 03:36

1 resposta

1

Em my.cnf adicione as seguintes linhas no [mysqld]:% long_query_time = 5
log-slow-queries

Em seguida, reinicie o MySQL e procure por quaisquer consultas aparecendo lá (qualquer uma que demore mais de 5 segundos para ser executada). Também é possível que o MySQL não seja realmente o problema, é o Apache martelando-o.

    
por 13.11.2010 / 03:47