简体   繁体   中英

Hikari connection pool exhausted

I have spring boot application which use hikari pool to create connection pool. we are using postgres sql for db. when I hit the system with low qps the request takes around 200 ms to execute. When One pod is deployed and the qps is 15 things remain in good state. but as soon as I increase the qps to 20 the request starts taking ~10 sec to process and connection pool becomes empty( java.sql.SQLTransientConnectionException: phoenix - Connection is not available, request timed out after 30183ms).

I am using this configuration.

spring.datasource.hikari.maximum-pool-size=200
spring.datasource.hikari.connectionTimeout=10000
spring.datasource.hikari.minimum-idle=50
spring.datasource.hikari.idle-timeout=0
spring.datasource.hikari.max-lifetime=30000
spring.datasource.TYPE=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.leak-detection-threshold=10000

The pod cpu usage goes max till 30% and memory usage is also under control. I am using an aws hosted postgress which can have 10000 parallel connection to the db. Can someone please help me here?

Please note you have a wrong property name:

spring.datasource.hikari.connection-timeout=5000

instead of:

spring.datasource.hikari.connectionTimeout=10000

source: spring docs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM