Help Center> Document Database Service> Developer Guide> Application Development> Common Parameter Configuration on the Driver Side
Updated on 2023-09-05 GMT+08:00

Common Parameter Configuration on the Driver Side

Common Configuration Items and Recommended Values for Connecting to a DDS DB Instance

  1. connectTimeoutMS: This connection timeout parameter prevents infinite waiting of the driver during the connection. Recommended configuration:

    connectTimeoutMS = 10000ms

  2. socketTimeoutMS: This parameter prevents infinite waiting of TCP communication. Recommended configuration:

    The duration is two to three times the maximum service duration. The minimum duration is 10s.

    socketTimeoutMS = max(10000ms, 3 times the maximum service time)

  3. minPoolSize: minimum number of connections in the connection pool. Recommended configuration:

    minPoolSize = 10

  4. maxPoolSize: maximum number of connections in the connection pool. Recommended configuration:

    maxPoolSize = 50 - 100

  5. maxIdleTimeMS: maximum idle duration that a connection can remain in the pool before it is deleted and closed. Recommended configuration:

    maxIdleTimeMS = 10000ms

Do not use socketTimeoutMS to prevent an operation from running for a long time on the database side. maxTimeMS is required so that the server can cancel operations that have been abandoned by the client.