Archive for the ‘MongoDB’ Category

“WT_CONNECTION.open_session: only configured to support 20020”

Frankly speaking, the explanation provided in SERVER-30421 and SERVER-17364 is a bit vague and “hand wavy” to me but at least there are steps that could help mitigate it: Decrease idle cursor timeout (default value is 10 minutes): In mongodb.conf: setParameter: cursorTimeoutMillis: 30000 Using mongo cli: use admin db.runCommand({setParameter:1, cursorTimeoutMillis: 30000}) Increase session_max: storage: wiredTiger: […]

Posted on February 22, 2018 at 9:26 am by sergeyt · Permalink · Leave a comment
In: MongoDB

Changing Oplog size or when root role is not enough

Managing MongoDB sometimes involves increasing Oplog size sine the default setting (5% of free disk space if running wiredTiger on a 64-bit platform) is not enough. And if you’re running MongoDB older than 3.6 that requires some manual intervention described in the documentation. It’s pretty straightforward even if it requires a node downtime as part […]

Posted on February 2, 2018 at 9:34 am by sergeyt · Permalink · Leave a comment
In: MongoDB

MongoDB 3.4 or stay on 3.2?

If you’re herding multiple shards this one should be convincing enough to jump on 3.4 bandwagon: mongos> sh.getBalancerHost() getBalancerHost is deprecated starting version 3.4. The balancer is running on the config server primary host.

Posted on September 11, 2017 at 12:39 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

How to reuse dropped sharded collection’s name

It happens that sometimes you want to drop your sharded collection and be able to reuse its name again. However, it might not be as straightforward as one expects it to be: mongos>sh.shardColelction(“your_database.your_collection”, { “sharded_key”: 1}) “code” : 13449, “ok” : 0, “errmsg” : “exception: collection your_database.your_collection already sharded” The error message might be different […]

Posted on July 19, 2017 at 12:35 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

TIL MongoDB Index Build could exceed 100%

A quote from SERVER-7631: Since data can be inserted while its running, this can go over 100 by design.

Posted on July 4, 2017 at 2:23 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

Restart your Mongos after maxConsecutiveFailedChecks

Take it literally. If you configured your MongoDB config servers as a replica set and for some reason, say a network outage, Mongos server lost connection to all of them and is not able to reconnect during maxConsecutiveFailedChecks attempts then, surprise, it becomes useless. Even if the network is up and running again, Mongos will […]

Posted on February 9, 2017 at 5:03 pm by sergeyt · Permalink · Leave a comment
In: MongoDB

jbd2 is munching your disks? Use ftrace to find why.

Have you ever been wondering why jbd2 (or jbd if your are still using ext3) is sitting at the top of iotop and consuming the most of IO bandwidth? Well, it’s certainly not because it’s doing that just to drive you nuts but there is a reason. And the reason is most probably there is […]

Posted on January 27, 2017 at 11:51 am by sergeyt · Permalink · 2 Comments
In: Linux, MongoDB

MongoDB – Defeating RangeDeleter

Not closing a cursor in MongoDB could hurt you big, so it’s generally not recommended to use no_cursor_timeout=True (pymongo3) or timeout=False (pymongo2). Especially when you run shared MongoDB installation: PyMongo does “close” cursors when they are garbage collected, but they aren’t closed immediately and closing a cursor in all current versions of MongoDB is asynchronous. […]

Posted on January 19, 2017 at 7:47 pm by sergeyt · Permalink · Leave a comment
In: MongoDB