Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Property NameHow to tune
Min. IdleConfigure this to match the expected minimum concurrency. The default value is 0.
Max. IdleThe value should be less that the Max. Active value. For high performance, tune Max. Idle to match the number of average, concurrent requests to the pool. If this value is set to a large value, the pool will contain unnecessary idle connections.
Max. Active

The maximum latency (approximately) = (P/M)T ,

 where,

  •  M = Max. Active value
  • P = Peak concurrency value
  • T = Time taken to process a quer

       Max. Active value = M

       The peek concurrency value = P

        Time taken to complete to process a query = t

Then the maximum latency (approximately) = (P/M)t
  • query.

Therefore, by increasing the Max. Active value ( up to the expected highest number of concurrency), the time that requests wait in the queue for a connection to be released will be decreases. But before increasing the Max. Active value, consult the database administrator, as it takes up system resources unnecessarily.

Max. Wait

Adjust this value to a value slightly higher than the maximum latency for a request.

That is, the  Max. Wait = (P/M)t + buffer time

Validation QuerySet "Validation Query" to a simple test query like SELECT 1
Test On BorrowWhen the connection to the database is broken, the connection pool does not know that the connection has been lost. As a result, the connection pool will continue to distribute connections to the application until the application actually tries to use the connection. To resolve this problem, set "Test On Borrow" to "true" and make sure that the "Validation Query" property is set.
validationIntervalThis parameter allows to control how frequently a given validation query is executed. By default it is set to 30 seconds. Deciding the value for the "validationInterval" property is a bit tricky. If a larger value is set, the frequency of executing the Validation Query is low, which results in better performance. With a smaller value, a stale connection will be identified quickly when it is presented. Therefore, selecting a value for the this property is a trade-off and ultimately depends on what is acceptable for the application.

...