Skip to content

CSHARP-4327: Update Server Monitoring documentation #967

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 1 commit into from
Nov 23, 2022
Merged
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
7 changes: 6 additions & 1 deletion Docs/reference/content/reference/driver_core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ Connection pooling is provided for every server that is discovered. There are a

### Server Monitoring

Each server that is discovered is monitored. By default, this monitoring happens every 10 seconds and consists of a `{ hello: 1 }` (or legacy hello) call followed by a `{ buildInfo: 1 }` call. When servers go down, the frequency of these calls will be increased to 500 milliseconds. See the [Server Discovery and Monitoring Specification](https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.rst) for more information.
Each server that is discovered is monitored.

MongoDB 4.4 or later: The `MongoClient` establishes an exhaust cursor to each discovered cluster node using `{ hello: 1 }` (or legacy hello). Cluster nodes push topology updates to `MongoClient`.
MongoDB 4.2 or ealier: The `MongoClient` polls each discovered cluster node every [heartbeatFrequencyMS](https://www.mongodb.com/docs/manual/reference/connection-string/#mongodb-urioption-urioption.heartbeatFrequencyMS) (default 10 seconds, MongoDB Atlas 5 seconds) using `{ hello: 1 }` (or legacy hello).

When servers go down, the frequency of these calls will be increased to 500 milliseconds. See the [Server Discovery and Monitoring Specification](https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-summary.rst) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have such logic about 500ms? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we do:

public ServerMonitorSettings(TimeSpan connectTimeout, TimeSpan heartbeatInterval, Optional<TimeSpan> minHeartbeatInterval = default)
{
    _connectTimeout = connectTimeout;
    _heartbeatInterval = heartbeatInterval;
    _minHeartbeatInterval = minHeartbeatInterval.WithDefault(TimeSpan.FromMilliseconds(500));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I misunderstood, I meant that we don't wait if network error in streaming


### Server Selection

Expand Down