Skip to content

DOCS-924 rewrite faq entry on mongos connections #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions source/faq/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,23 +193,23 @@ behavior.
How many connections does each ``mongos`` need?
-----------------------------------------------

Typically, each client maintains as connection to
:program:`mongos`. :program:`mongos` maintains a connection pool to
support a single outgoing connection to each shard for. For incoming
connections that direct read operations to secondaries, the
:program:`mongos` will also need to maintain connects to each member
of the replica set that provides the shard.

Why does ``mongos`` hold connections?
-------------------------------------
Each client maintains a connection to a :program:`mongos` instance.
Each :program:`mongos` instance maintains a pool of connections to
the members of a replica set supporting the sharded cluster.
Connections between :program:`mongos` and :program:`mongod` instances
are used by one client at a time (requests are not multiplexed or
pipelined) and then returned to the connection pool.

Why does ``mongos`` hold connections open?
------------------------------------------

:program:`mongos` uses a set of connection pools to communicate with
each :term:`shard`. These pools do not shrink when the number of
clients decreases.

This can lead to an unused :program:`mongos` with a large number open
of connections. If the :program:`mongos` is no longer in use, you're
safe restarting the process to close existing connections.
This can lead to an unused :program:`mongos` with a large number
of open connections. If the :program:`mongos` is no longer in use,
it is safe to restart the process to close existing connections.

Where does MongoDB report on connections used by ``mongos``?
------------------------------------------------------------
Expand Down
21 changes: 9 additions & 12 deletions source/reference/mongos.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.. default-domain:: mongodb
.. _mongos:

==========
``mongos``
==========

.. default-domain:: mongodb

Synopsis
--------
Expand All @@ -17,23 +17,20 @@ From the perspective of the application, a
:program:`mongos` instance behaves identically to any other MongoDB
instance.

.. seealso::

See the ":wiki:`Sharding`" wiki page for more information regarding
MongoDB's sharding functionality.

.. STUB ":doc:`/core/sharding`"

.. note::

.. versionchanged:: 2.1

Some aggregation operations using the :dbcommand:`aggregate` will
cause :program:`mongos` instances to require more CPU resources
than in previous versions. This modified performance profile may
dictate alternate architecture decisions if you make use the
dictate alternate architecture decisions if you use the
:term:`aggregation framework` extensively in a sharded environment.

.. seealso::

* :doc:`/sharding`
* :doc:`/core/sharding`

Options
-------

Expand Down Expand Up @@ -252,8 +249,8 @@ Options

.. versionadded:: 2.2

:option:`--localThreshold` affects the logic that program:`mongos`
uses when selecting :term:`replica set` members to pass reads
:option:`--localThreshold` affects the logic that :program:`mongos`
uses when selecting :term:`replica set` members to pass read
operations to from clients. Specify a value to
:option:`--localThreshold` in milliseconds. The default value is
``15``, which corresponds to the default value in all of the client
Expand Down
1 change: 1 addition & 0 deletions source/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Reference
The following reference section describes sharding commands:

- :ref:`sharding-commands`
- :ref:`faq/sharding.txt`

.. STUB tutorial/replace-one-configuration-server-in-a-shard-cluster
.. STUB tutorial/replace-all-configuration-servers-in-a-shard-cluster