docs/priority_port.md
mongod and mongos support a dedicated priority port intended for internal, high-priority operations such as automation monitoring, MongoTune, and critical intra-cluster replication traffic.
With a priority port configured:
The feature is disabled by default.
mongod and mongosYou can configure the priority port via command line or config file:
Command line:
mongod --port <mainPort> --priorityPort <priorityPort> ...
mongos --port <mainPort> --priorityPort <priorityPort> ...
YAML config file:
net:
port: <mainPort>
bindIp: localhost,<hostnames-or-ip-addresses>
priorityPort: <priorityPort>
When the transport layer starts:
Priority-port connections differ from normal connections in several ways.
When a new connection is accepted:
Metrics:
serverStatus.connections.priority counts current connections on the priority port only.connections.limitExempt (along with CIDR-based exemptions).Two ingress-side rate limiters recognize priority-port exemptions:
For observability and debugging, the server records whether an operation came through the priority port:
CurOp / currentOp output includes a flag indicating the connection is from the priority port.To connect to a replica set via the priority port, a user must:
directConnection=true to disable SDAM and prevent the driver from using hello-based host discovery, which currently does not advertise the priority port.Example:
mongodb://hostA:27018/?directConnection=true
mongosFor mongos:
mongos priority port.directConnection=true is not required for mongos connections, since SDAM is not used in the same way.Important limitation:
mongos via the priority port and mongos forwards a command to shards, those shard-side connections still use the main ports and do not inherit priority-port behavior in the current implementation.