Linked Questions
14 questions linked to/from How to close idle connections in PostgreSQL automatically?
132 votes
7 answers
345k views
Is there a timeout for idle PostgreSQL connections?
1 S postgres 5038 876 0 80 0 - 11962 sk_wai 09:57 ? 00:00:00 postgres: postgres my_app ::1(45035) idle 1 ...
140 votes
5 answers
94k views
Terminate hung query (idle in transaction)
I'm using Heroku with the Crane Postgres option and I was running a query on the database from my local machine when my local machine crashed. If I run select * from pg_stat_activity one of the ...
20 votes
5 answers
7k views
Is it possible to intercept kill signals to close DB connections right before a lambda function is killed and started cold?
To speed up Lambda execution, I am trying to move some parts of my Python code outside the handler function As per Lambda's documentation: After a Lambda function is executed, AWS Lambda maintains ...
8 votes
1 answer
21k views
How to shut down idle connections to Postgres DB in Amazon RDS
We have a Postgres database set up in the RDS. I wrote some APIs to handle data ingestion to the db using Spring Boot. Recently I discovered that lots of connections kept their sessions alive after ...
1 vote
1 answer
9k views
DEALLOCATE pdo_stmt it's taking to much time (days), is it normal?
I was debugging my PostgreSQL database and found 7 queries for "DEALLOCATE pdo_stmt" that have been running for 15 days. Reading from the PostgreSQL docs, I see that these queries are supposed to ...
4 votes
1 answer
1k views
Django 1.11 PostgreSQL - "SET TIME ZONE" command on every session
We are working out a couple of performance issues on one of our web sites, and we have noticed that the command "SET TIME ZONE 'America/Chicago'" is being executed so often, that in a 24 hour period, ...
0 votes
1 answer
5k views
How to close idle connection on PostgreSQL database
I've been accessing a postgreSQL database with python3 and psycopg2. I encountered an error that implied I had open connections. When I ran SELECT * FROM pg_stat_activity a bunch of connections under ...
0 votes
1 answer
3k views
I would like to set idle_in_transaction_session_timeout for a Heroku Postgres database
Based on this solution I would like to change the idle_in_transaction_session_timeout in Heroku Postgres, however I do not have the rights as a superuser (see Heroku default permissions). Are there ...
3 votes
0 answers
3k views
Idle (not idle in transaction) connections are not released/closed in PostgreSQL AWS RDS
I'm using C3P0 connection pool and PostgreSQL(10.3) in AWS RDS. I did a load test at low TPS (1 TPS) for 2 minutes, after load test finished, the number of connections were not dropped according to ...
3 votes
1 answer
3k views
Releasing JDBC connections after kubernetes pod is killed
I am running a couple of spring boot apps in Kubernetes. Each app is using spring JPA to connect to a Postgresql 10.6 database. What I have noticed is when the pods are killed unexpectedly the ...
0 votes
1 answer
1k views
How long for Postgres to drop idle user [duplicate]
I had a user who was having a crashing issue with our app and was not closing his connection to the database properly - eventually reaching his connection limit and was unable to log back in. That's ...
2 votes
0 answers
656 views
Failed to validate connection Pooled connection wrapping physical connection
I'm working on a Spring MVC project (Spring version 4.1.1), and I configured HikariCP as connection pool manager. When the application is not used for a while, it seems like Hikari starts losing ...
1 vote
1 answer
378 views
When does Djangos CONN_MAX_AGE get checked/used?
I recently had a "Too many connections" issues of my Django+Celery application with a Postgres DB on Heroku. Could dyno restarts be the issue? The idea is that the dyno restart drops the ...
0 votes
1 answer
168 views
Azure: keeping connection in static variable to reuse it. Good strategy?
I am dealing with an Azure function that connects to a DB (Java), i suppose something quite common. The functions may have cold or warm starts, mine should be warm for most of the time (it is called ...