Mongodb’s Parameter Understanding

  mongodb, question

Ask the great god, do I understand mongodb’s following parameters?

MaxWaitTime=120000 refers to the waiting time for data return that has been connected to mongodb.

ConnectTimeout=10000 refers to the time when mongodb connection is requested and is not connected and waiting for connection.

SocketTimeout=0 means that the connection has been made and the data is being transferred. The process of data transfer will take time. Here is the waiting time until the end of data transfer.

There is an answer with 140 likes on Stackoverflow:How to configure MongoDB Java driver MongoOptions for production use?

  • connectTimeout. As the name suggest number of milliseconds the driver will wait before a connection attempt is aborted. Set timeout to something long (15-30 seconds) unless there’s a realistic, expected chance this will be in the way of otherwise succesful connection attempts. Normally if a connection attempt takes longer than a couple of sec onds your network infrastructure isn’t capable of high throughput.

  • maxWaitTime. Number of ms a thread will wait for a connection to become available on the connection pool, and raises an exception if this does not happen in time. Keep default.

  • socketTimeout. Standard socket timeout value. Set to 60 seconds (60000).