Intermittent Pooler Error in django app server
facing intermittent Pooler Error: server conn crashed?
in my http server. Tried searching and fixing long running transaction in my system but didn't help. Also this happens very randomly at any point in time without any co-relation with traffic.
Sharing error logs:
2025-01-31 11:41:07.067 1 LOG C-0x55d7847ac110: logs/server_application_api@127.0.0.1:34186 closing because: client close request (age=0)
2025-01-31 11:41:07.051 1 LOG C-0x55d7847ac110: logs/server_application_api@127.0.0.1:34186 login attempt: db=test user=server_application_api tls=no
2025-01-31 11:41:06.988 1 LOG C-0x55d7847ac110: logs/server_application_api@127.0.0.1:34096 closing because: client close request (age=0)
2025-01-31 11:41:06.968 1 LOG C-0x55d7847ae820: logs/server_application_api@127.0.0.1:34048 closing because: client close request (age=0)
2025-01-31 11:41:06.952 1 LOG C-0x55d7847ac110: logs/server_application_api@127.0.0.1:34096 login attempt: db=test user=server_application_api tls=no
2025-01-31 11:41:06.948 1 WARNING C-0x55d7847ac110: logs/server_application_api@127.0.0.1:40674 Pooler Error: server conn crashed?
This error is due to a problem in connection between your application and PostgreSQL and/or with pgbouncer.
As this is a generic error message which can be caused by a couple of factors, it is best to (as has been suggested in the comments) check the PostgreSQL and pgbouncer logs to see if there are details about this error.
You should also check if your network is in good condition as I have experienced this error before due to network issues. Also ensure that firewalls are not affecting connections to your database.
Also you might want to check your pgbouncer configuration to ensure they can handle client requests appropriately. For instance, you might want to set the total number of clients that can connect to some high value e.g: max_client_conn=5000
and ensure that default_pool_size
and other configurations are correctly set according to your specific use case.