mongodb cpu 超过100%居高不下的原因分析过程

本文记录了一次 MongoDB 数据库出现高 CPU 使用率的问题排查过程。通过查看系统监控、进程状态、日志文件等手段定位问题原因,并最终确定为正常缓存行为,排除了故障。

-- mongodb cpu is high, infomation as below:


1 the message in the http://10.100.1.11:28017/ as below:
conn 3188663 R 2004 apollo.eacmscache { key: "mpage:en_US:layout.www.origin.com/connect_default" } 10.100.10.114:37852

2 check top status,find the hightest process, the pid is 19271
top - 02:56:01 up 830 days, 7:12, 3 users, load average: 4.23, 3.68, 3.53
Tasks: 248 total, 1 running, 247 sleeping, 0 stopped, 0 zombie
Cpu(s): 6.7%us, 2.7%sy, 0.0%ni, 88.5%id, 1.3%wa, 0.1%hi, 0.7%si, 0.0%st
Mem: 49430528k total, 49291660k used, 138868k free, 231876k buffers
Swap: 33551744k total, 2134896k used, 31416848k free, 47219484k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
19271 root 15 0 387g 9.8g 9.6g S 140.2 20.7 48:49.53 mongod
14551 root 15 0 480g 11g 11g S 15.9 24.4 18:21.43 mongod

3 find the process name of pid 19271
[root@346437-eastore_db1 ~]# ps -eaf|grep mongo
root 14551 1 31 01:59 ? 00:19:19 /db/mongodb/bin/mongod -f /etc/mongodb/27017.conf
root 14558 1 1 01:59 ? 00:00:50 /db/mongodb/bin/mongod -f /etc/mongodb/27019.conf
root 17742 21933 0 03:00 pts/2 00:00:00 grep mongo
root 19271 1 87 02:00 ? 00:53:24 /db/mongodb/bin/mongod -f /etc/mongodb/27018.conf
root 23465 4278 0 01:38 ? 00:00:00 sshd: mongo [priv]
mongo 25215 23465 0 01:40 ? 00:00:00 sshd: mongo@pts/1
mongo 25219 25215 0 01:40 pts/1 00:00:00 -bash
it is /db/mongodb/bin/mongod -f /etc/mongodb/27018.conf

4 see the log
find the log directory in /etc/mongodb/27018.conf, it is ok, nothing error infomation.

5, see the message in http://10.100.1.11:28017/ again
there are many info about: apollo.eacmscache { key: "mpage:en_US:layout.www.origin.com/connect_default" }
check the db apollo anc the collecion eacmscache, the index of key is created,
Is many query of apollo.eacmscache cause the cpu spike ?

6 now, i see the w status, the cpu is normal, and why ? i can't find any error infomation about this spike.

7 i sent email to jeff,and he told me :
they are pictures cache of the website of OC,it's ok,np,ignore it,pls.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值