[SERVER-9022] Enable mongos mode which releases ShardConnections to the pool after read ops Created: 19/Mar/13  Updated: 27/Oct/15  Resolved: 20/Mar/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.2.4, 2.4.2, 2.5.0

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DOCS-1326 Document releaseConnectionsAfterRespo... Closed
Duplicate
duplicates SERVER-8224 when lots of web server, there is t... Closed
Related
related to SERVER-1714 multiplex mongos -> mongod connecions... Closed
related to SERVER-9055 Explicitly detect invalid gle reuse w... Closed
is related to SERVER-7008 socket exception [SEND_ERROR] on Mong... Closed
is related to SERVER-6991 Add pool stats for ShardedConnection Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Create a new serverParameter for mongos, "releaseConnectionsAfterResponse," which enables returning ShardConnections from the per-socket pool to the global pool after each read operation. This should reduce the total number of outgoing mongos connections to each shard.

Warning: Enabling this option on mongos comes with the caveat that clients can only call getLastError immediately after an actual write operation. This is fine for the vast majority of use cases. However, if an application does:

  • write op (no GLE)
  • read op
  • GLE w=2 — this will not provide any semantic guarantees (and may in fact return an unrelated error)

If your application only ever calls GLE immediately after an actual write op (which is the same as using safe mode), this option will provide a good bit of multiplexing.

The behavior is off by default. To turn the behavior on (and off) a running mongos, use the standard setParameter framework -

mongo <mongos>
> use admin
> db.runCommand({ setParameter : 1, releaseConnectionsAfterResponse : true })
{ was : false, ok : true }

To turn the behavior on at startup in a 2.4 mongos (this is not available before 2.4), you can also use:

shell> mongos --setParameter "releaseConnectionsAfterResponse=true" --configdb ...



 Comments   
Comment by auto [ 21/Mar/13 ]

Author:

{u'date': u'2013-03-21T22:03:39Z', u'name': u'Dan Pasette', u'email': u'dan@10gen.com'}

Message: SERVER-9022: command line option for releaseConnectionsAfterResponse
Branch: v2.2
https://github.com/mongodb/mongo/commit/5d5fe49dfb5f452832b9d44fddbfb2a4e8b42f2a

Comment by auto [ 20/Mar/13 ]

Author:

{u'date': u'2013-03-20T16:54:47Z', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-9022 allow releasing sharded conn back to pool after read operation
Branch: v2.2
https://github.com/mongodb/mongo/commit/74323d671a216c8c87fcb295ed743f830d5212ee

Comment by Greg Studer [ 19/Mar/13 ]

Author:

{u'date': u'2013-03-14T19:03:03Z', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-6991 allow releasing sharded conn back to pool after read operation
Branch: master
https://github.com/mongodb/mongo/commit/706459a8af0b278609d70e7122595243df6aeee8

Generated at Thu Feb 08 03:19:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.