mongo突然变慢,查询性能急剧下降问题请教

jinglong_cs 2015-10-26 02:50:20
版本:
./bin/mongod -version
db version v1.8.4-pre-, pdfile version 4.5

部署:
问题mongo是从,在一台单独的服务器上,只有mongo应用。

日志:
Sat Oct 24 10:04:47 [conn122749] query novel.$cmd ntoreturn:1 command: { distinct: "mcp_book_author_info", key: "penname", query: { authorcpid: { $ne: 128 }, penname: { $options: "I", $regex: "农" } } } reslen:1026 119ms
Sat Oct 24 10:04:47 [conn122749] query novel.mcp_book_basic_info reslen:6749 nscanned:59916 { contactid: { $ne: 128 }, title: { $options: "I", $regex: "农" } } nreturned:101 185ms
Sat Oct 24 10:04:48 [conn122314] assertion 10105 bad skip value in query ns:novel.mcp_book_topic_map query:{ $query: { topicid: 0 }, $orderby: { seq: -1 } }
Sat Oct 24 10:04:48 [conn122314] ntoskip:-20 ntoreturn:20
Sat Oct 24 10:04:57 [replslave] repl: applied 1 operations
Sat Oct 24 10:04:57 [replslave] repl: end sync_pullOpLog syncedTo: Oct 24 10:04:45 562ae73d:1
Sat Oct 24 10:04:57 [replslave] repl: from host:11.11.4.12:30000
Sat Oct 24 10:04:57 [conn117048] serverStatus was very slow: { after basic: 0, middle of mem: 7770, after mem: 7770, after connections: 7770, after extra info: 7770, after counters: 7770, after repl: 7770, after asserts: 7770 }
Sat Oct 24 10:04:57 [conn117048] query admin.$cmd ntoreturn:1 command: { serverStatus: 1 } reslen:1284 7858ms
Sat Oct 24 10:04:58 [conn123186] query novel.$cmd ntoreturn:1 command: { distinct: "mcp_book_author_info", key: "penname", query: { authorcpid: { $ne: 128 }, penname: { $options: "I", $regex: "农妇山泉" } } } reslen:132 1201ms
Sat Oct 24 10:05:13 [conn122753] query novel.mcp_book_chapter_0 ntoreturn:1 reslen:269 nreturned:1 16315ms
Sat Oct 24 10:05:13 [conn123100] query novel.mcp_book_chapter_14 ntoreturn:1 reslen:252 nreturned:1 16315ms
Sat Oct 24 10:05:13 [conn122835] query novel.mcp_book_chapter_48 ntoreturn:1 reslen:262 nreturned:1 16314ms

解释:
在10:04:47之前,业务有一部分模糊查询,响应时间在200ms左右,都属于正常。
在10:04:48之后,日志里看应该是有数据同步,之后的查询突然性能急剧下降,很久才返回。
大概持续了一个小时左右,又恢复正常。

不是很懂mongo,求大神分析一下原因,顺便求解决办法,防止再出现这样的问题。
...全文
551 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
rucypli 2015-10-27
  • 打赏
  • 举报
回复
看看机器上在这段时间有什么计划任务 或者谁有操作
jinglong_cs 2015-10-27
  • 打赏
  • 举报
回复
引用 3 楼 jinglong_cs 的回复:
[quote=引用 1 楼 rucypli 的回复:] 看看机器上在这段时间有什么计划任务 或者谁有操作
用,只有我的python和C++服务回去读取这mongo里的数据[/quote] 而且看我的应用服务日志里,并不是每个查询都慢,有些查询还是能正常返回,在几ms内返回。
jinglong_cs 2015-10-27
  • 打赏
  • 举报
回复
引用 1 楼 rucypli 的回复:
看看机器上在这段时间有什么计划任务 或者谁有操作
用,只有我的python和C++服务回去读取这mongo里的数据
jinglong_cs 2015-10-27
  • 打赏
  • 举报
回复
引用 1 楼 rucypli 的回复:
看看机器上在这段时间有什么计划任务 或者谁有操作
这台机器上就只跑了一个mongo,单独的服务器 没有运行其他的脚本或是程序 出问题的时间不固定 之前一直没遇到,最近出现了3次,一次晚上22点左右,一次下午五点,这次是上午10点多 不知道是因为模糊查询引起的,还是数据同步同时查询引起的 mongostat查看的query也不大,1s 200左右

1,746

社区成员

发帖
与我相关
我的任务
社区描述
MongoDB相关内容讨论区
社区管理员
  • MongoDB社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧