-1

what is the proper connection pool configuration for TDengine database?

I encountered this error:

connection is not available after 30 seconds.

my configuration is :

maximumPoolSize=10
minimumIdle=5
maxLifetime=0
connectionTimeout=30000
idleTimeout=0

does it good for using ? Does increasing maximumPoolSize guarantee that the Connection is not available?I want to know the best configuration for this

Yu Chen
  • 70
  • 1
  • 5

1 Answers1

0

maximumPoolSize = threadSize / (connectionTimeOut * timePerSQL)

threadSize: The number of threads executing SQL simultaneously

connectionTimeOut: indicates the timeout period of the connection

maximumPoolSize: indicates the maximum number of connections in the connection pool

timePerSQL: execution time per thread.

The number of threads can be greater than the number of connection pools, but please make sure that connections are released in a timely manner within the thread. For example, if it takes 5 seconds to get a connection in each thread , execute the query and close the connection.

maximumPoolSize is 10 and connectionTimeout is 30 second, the processing capacity of the application is 30/5s * 10, that is, the maximum number of connections that can be maintained is 60. If the number exceeds 60, an error will definitely be reported.

hence maximumPoolSize is 60 . but it also depends on the cpu of your server,that would be complicated

Yu Chen
  • 70
  • 1
  • 5