We have a java application that uses Postgres v11 along with PgBouncer for connection pooling. When we keep the application idle for 15 mins, the connection drops(JDBC). The database is hosted on Amazon AWS
The same is observed in Pgadmin.
We tried TCP keepalive and few others. Nothing works.
Any ideas?
Most connection pools have setting like "keep alive time", "keep alive query". You can set them in the Java application to prevent network timeout.
For example, for HikariCP:
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.