-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keepalive the Idle postgres connections #2362
Comments
You could use the undocumented |
oof I need to document that! |
@gopal-abbineni what you see is the keepalive packets sent by the server to the client. More about that here: https://www.postgresql.org/docs/9.6/runtime-config-connection.html. |
Hi all, what's the purpose of keepAliveInitialDelayMillis ? |
I'm struggling to find clear documentation on the implications of setting node-postgres seems to be using libpq. Libpq docs, nor node-postgres docs are clear on what happens when the connection to server is considered dead. Will it auto re-connect? Or does it require nodejs process restart. |
I'm using Google Cloud functions and my connections are killed every 2min. Currently, this causes an exception. How can I make it reconnect automatically? KeepAlive=true doesn't seem to help. |
Is there any reason Is it a finished feature? 😅 |
After some lengthy periods of inactivity in our stage environment (overnight, every night), the first attempt to write to pg consistently fails. The second and all other subsequent attempts succeed. It seems like the connections are being closed or are dying but are not removed from the connection pool. I'm left wondering if I should be using |
@brianc Could you comment on whether In particular, I am debugging why each query starts with |
I believe this documents implications of https://stackoverflow.com/a/46884708/368691
|
I don't think this is true if the server runs gets hosed and stops sending TCP responses on an existing connection, see: #1942 (comment) My life would have been better if keepalive had been enabled by default. Is there that much downside for people who don't need it? |
In our scenario there are router/switches that will reset the connection if the connection is idle for more than 5 min. This throws the ECONNRESET error and crashing up the server. Is there any way to keep the connection idle from pg cliient.
The text was updated successfully, but these errors were encountered: