serverSelectionTimeoutMS determines the maximum amount of time to spend in the server selection loop. This defaults to 30 seconds, but applications will typically fail sooner if serverSelectionTryOnce is true and a smaller connectTimeoutMS value is in effect.
The original default was established at a time when replica set elections took much longer to complete. Applications can consider setting this option to slightly more than the expected completion time for an election