title: Understanding MongoDB timeout settings
body: <p>I am having a hard time understanding what is the best timeout settings to configure for my application There are three types of timeout settings:</p>
  <p>connectTimeoutMS
  socketTimeoutMS
  maxTimeMS</p>
  <p>and along with them we also have:</p>
  <p>KeepAlive
  poolSize
  autoReconnect</p>
  <p>connectTimeout corresponds to the timeout setting when the application fails to connect to mongoDB within the specificed timeframe. I assume this will result into an exception.</p>
  <p>socketTimeoutMS corresponds to the socket waits to get a response from the db server before closing.</p>
  <p>maxTimeMS corresponds to the timeout of an operation running in the db. This results in an exception.</p>
  <p>What is the difference between socketTimeout and maxTimeout?. I have the requirement that I have to log an error code for when Request to Database has timed out after {5} seconds. No response is received from this Database. What is the best timeout setting for this purpose?</p>
  <p>How is poolsize, keepAlive, auto connected conected to the timeout settings? Examples would be useful.</p>