Skip to content

DOCS-10739 - Adding listenBacklog parameter #2998

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

Closed
wants to merge 1 commit into from
Closed
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
53 changes: 51 additions & 2 deletions source/includes/options-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,55 @@ post: |
``--bind_ip`` and ``--bind_ip_all`` are mutually exclusive. That
is, you can specify one or the other, but not both.

---
program: mongod
name: listenBacklog
default: Target system ``SOMAXCONN`` constant
args: <number>
directive: option
description: |
.. versionadded:: 3.6

The maximum number of connections that can exist in the listen
queue.

.. warning ::

Consult your local system's documentation to understand the
limitations and configuration requirements before using this
parameter.

.. important::

To prevent undefined behavior, specify a value for this
parameter between ``1`` and the local system ``SOMAXCONN``
constant.

The default value for the ``listenBacklog`` parameter is set at
compile time to the target system ``SOMAXCONN`` constant.
``SOMAXCONN`` is the maximum valid value that is documented for
the *backlog* parameter to the *listen* system call.

Some systems may interpret ``SOMAXCONN`` symbolically, and others
numerically. The actual *listen backlog* applied in practice may
differ from any numeric interpretation of the ``SOMAXCONN`` constant
or argument to ``--listenBacklog``, and may also be constrained by
system settings like ``net.core.somaxconn`` on Linux.

Passing a value for the ``listenBacklog`` parameter that exceeds the
``SOMAXCONN`` constant for the local system is, by the letter of the
standards, undefined behavior. Higher values may be silently integer
truncated, may be ignored, may cause unexpected resource
consumption, or have other adverse consequences.

On systems with workloads that exhibit connection spikes, for which
it is empirically known that the local system can honor higher
values for the *backlog* parameter than the ``SOMAXCONN`` constant,
setting the ``listenBacklog`` parameter to a higher value may reduce
operation latency as observed by the client by reducing the number
of connections which are forced into a backoff state.

optional: true
---
program: mongod
name: maxConns
Expand All @@ -130,8 +179,8 @@ description: |
accept. This setting has no effect if it is higher than your operating
system's configured maximum connection tracking threshold.

Do not assign too low of a value to this option, or you will encounter errors
during normal application operation.
Do not assign too low of a value to this option, or you will
encounter errors during normal application operation.
post: |
.. include:: /includes/note-max-conns-max.rst
optional: true
Expand Down
2 changes: 2 additions & 0 deletions source/reference/program/mongod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Core Options

.. include:: /includes/option/option-mongod-ipv6.rst

.. include:: /includes/option/option-mongod-listenBacklog.rst

.. include:: /includes/option/option-mongod-maxConns.rst

.. include:: /includes/option/option-mongod-logpath.rst
Expand Down