http://grokbase.com/t/gg/mongodb-user/1266hzp11z/slow-query-hang-all-the-replica
Hi!
I have a mongodb system with 1 master (v1.8.2) and 1 replica (was
v1.8.2 but i've recently upgraded to v2.0.6), both Linux with 4GB RAM,
with 1 database with 16 tables but only one is big (442k documents)
and is getting me into troubles. I run 98% of the queries on the
replica.
Database and bigger table (news) stats: http://pastebin.com/qZu8cB1U
The problem:
I noticed that from time to time, my replica use to hang for some
seconds (can be 10 seconds, can be 1 minute - usually is about 1
minute). This is obviously a undesired situation of unavailability.
To find out what was going on:
1- I've put mongostat writing into a file for watching later, and..
after a couple of hours, i was able to see this periods on the log
file. Example: http://pastebin.com/JBs0xwWx
. We can see the values on
the faults column getting high. On this moments, the iostat %util is
beating on 97 - 98.
2- I've activated the database profiler for queries taking more then 3
seconds:
db.setProfilingLevel(1,3000);
Here we could see that two heavy queries reached the server and the
next queries hang on waiting.
I could see too that the other queries finish almost all at the same
time (next milliseconds).
Profiling info: http://pastebin.com/0ZENXUDA
3- I've put a script watching mongostat, detecting this problematic
situations and saving db.currentOP() into a file. Here is one of the
results: http://pastebin.com/6iR45mbi
.
Here we can see that queries are active, some running for more than 30
seconds, seems that they are not "waitingForLock" but, as we can see
on the profiling data, the most of them look like pretty trivial
(nscanned: 62, nreturned : 16).
At this point i can't understand how the trivial queries take so long
time to run, after running one or two heavy queries.
Does somebody have an idea about what is going on and how to avoid
that 1 or 2 queries damage the all server well functioning?
Thank you.
:
Hi David,
I notice this question didn't have any follow up .. have you been able to
work out the cause for your intermittent slowdown?
Based on the mongostats information and your high rate of page faults
immediately after the batch of updates, it looks like you are experiencing
memory pressure (i.e. your server is bogged down swapping from memory to
disk and becomes unresponsive for a period of time). You could confirm
this by watching the swap activity reported by `vmstat 1`.
Is your replica set in MMS (https://mms.10gen.com/help/install.html)?
Would also be helpful to install Munin for resource monitoring.
~
分享到:
相关推荐
MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化MongoDB疑难杂症分析及优化...
Mongodb疑难杂症及优化.pdf
Windows 无法启动MongoDB服务 错误1067:进程意外终止1:Windows 无法启动MongoDB服务 错误1067:进程意外终止2:解决方法:进
资源名称:MongoDB应用设计模式内容简介:无论是在构建社交媒体网站,还是在开发一个仅在内部使用的企业应用程序,《MongoDB应用设计模式》展示了MongoDB需要解决的商业问题之间的连接。你将学到如何把MongoDB设计...
一、MongoDB简介 3 二、MongoDB结构 3 二、MongoDB 数据库关系型(这里并不是值关系型数据库的关系) 3 1、MongoDB一对一关系型 3 2、MongoDB一对多关系型 4 3、MongoDB多对多关系型 4 三、创建数据库(mongodb_test...
sudo vim /etc/yum.repos.d/mongodb-org-4.2.repo 写入: [mongodb-org-4.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.2/x86_64/ gpgcheck=1 enabled=1 gpg...
本课程是一套关于MongoDB应用开发的实战性教程,名为《深入浅出MongoDB应用实战开发(基础、开发指南、系统管理、集群及系统架构)》,教程侧重于讲解MongoDB的常用特性及高级特性,从实际开发的角度出发对MongoDB...
MongoDB数据库问题诊断指南.pptx
MongoDB 学习PPT
MongoDB图形化管理工具 MongoDB Compass
【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT必备】MongoDB面试题【BAT...
MongoDB的强事务解决方案.pdf
教程名称:MongoDB教程基础入门 课程目录:【】MongoDB教程基础入门-代码【】MongoDB教程基础入门01第一讲上【】MongoDB教程基础入门02第一讲下【】MongoDB教程基础入门03第二讲上【】MongoDB教程基础入门04第二讲...
旨在为WEB应用提供可扩展的高性能数据存储解决方案。 MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。它支持的数据结构非常松散,是类似json的bson格式,...
mv mongodb-linux-x86_64-4.0.18 mongodb 3、进入 mongodb 目录创建目录 db 和 logs cd /usr/local/mongodb mkdir db mkdir logs 4、进入到 bin 目录下,编辑 mongodb.conf 文件,内容如下: dbpath=/usr/local/...
mongodb,下载mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,mongodb,
旨在为WEB应用提供可扩展的高性能数据存储解决方案。 MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的。它支持的数据结构非常松散,是类似json的bson格式,...
MongoDB 5.0.6 windows版本
MongoDB4.2分片及副本集群搭建 MongoDB集群 MongoDB分片 MongoDB副本 MongoDB副本集群
mongodb-log 是一个基于MongoDB的Python日志系统。 MongoDB 的 Capped Collection是一个天生的日志系统,MongoDB自己的oplog就是用它来存储的,Capped Collection的特点是可以指定Collection的大小,当记录总大小...