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疑难杂症及优化 #### 一、Oplog问题概述 Oplog是MongoDB复制的核心机制之一,用于记录数据库中的更改事件。通过维护一个全局有序的日志,MongoDB可以确保副本集中的各个成员能够同步最新的数据变更。...
公司单节点升级到分片下,搜索了一圈大多数MongoDB集群的部署方案都是分片+副本集,没有讲述如何从单节点升级到分片+复制集的方法,亲自试验后记录整个过程以及中间的参考内容和疑难解决,以备后查。内容包含复制集+...
西路疑难解答v1.0是一款基于计算机技术的互动平台,设计类似于传统的留言本程序,旨在为用户提供一个在线问题提交和解答的空间。这个程序的核心功能是让访问者能够留下他们遇到的技术问题或者疑惑,并期待得到专家...
本压缩包文件“数据库疑难短问短答.rar”显然聚焦于解答数据库使用过程中的常见问题和难点,旨在帮助用户更好地理解和解决实际操作中的困惑。下面我们将深入探讨其中可能涉及的一些关键知识点。 1. **数据库类型**...
5. **系统调优能力**:熟悉JVM调优、数据库调优和Linux内核调优,能够解决系统瓶颈和疑难问题。 6. **虚拟化与云计算**:了解OpenStack架构,熟悉Xen、KVM等虚拟化技术,以及Oracle、MySQL、MongoDB等数据库的使用...
* 分析解决产品开发过程中的重要技术问题和疑难问题 4. 项目经历: * 企业能力开放平台(2021.01 - 至今) * 使用技术:SpringBoot、SpringCloud、MyBatis、Redis集群、OSS、RabbitMQ、ElastiSearch、Element UI...
2. **问题解决:**负责线上系统的监控、应急响应等,及时定位及解决性能瓶颈和疑难问题。 3. **容器云优化:**负责提升容器云产品整体稳定性、安全性、高可用性,优化平台性能。 4. **业务运维:**负责线上业务运维...
它通常具备搜索、解答、讨论等功能,旨在帮助用户快速找到课程中的疑难问题答案,提升学习效率。小程序源码是其背后的驱动力,通过编程语言和框架构建,实现了用户友好的交互界面和高效的数据处理能力。 二、技术栈...
源码分析对于开发者来说非常重要,它能帮助我们解决疑难问题,优化代码,以及更好地利用框架功能。 另一个标签“工具”可能指的是Spring生态系统中的工具,如Spring Boot、Spring Tool Suite(STS)或Spring ...