首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MySQL占用CPU (紧急)

问MySQL占用CPU (紧急)
EN

Server Fault用户
提问于 2010-11-13 02:36:15
回答 1查看 2.8K关注 0票数 2

最近,我清除了我的网站的缓存文件,现在MySQL正在消耗高达100%的CPU。它在5分钟内从10%慢慢增长到100%,所以服务器崩溃了。幸运的是,我通过#service mysql stop停止了服务,但是每次我打开它,它就开始消耗CPU。

下面是错误日志:

代码语言:javascript
复制
#/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

对不起,但我不知道怎么看这个。有人能帮忙吗?

EN

回答 1

Server Fault用户

回答已采纳

发布于 2010-11-13 02:47:44

在my.cnf中,在米舍尔德下添加以下行:

long_query_time = 5

log-slow-queries

然后重新启动MySQL并查找出现在其中的任何查询(任何运行时间超过5秒的查询)。MySQL也有可能不是真正的问题,而是Apache的锤击问题。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/201389

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档