Search Postgresql Archives

Force termination of an idle connection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi - 

I have a multi-threaded application that spawns child processes, inserts
information into the database, then disconnects. For whatever reason, some
of the children do not disconnect and the database is left with idle
connections (that eventually max out over time). How can I either force the
child thread to terminate the connection or have the database force a
disconnect after a specified time of inactivity? This is not an embedded C
application, and I believe the `statement_timeout` option only applies to
the database latency for each statement (though please correct me if I am
wrong). Ideally, the solution would be the logical equivalent of either
`terminate after n (milli)seconds of inactivity` or, a less desirable, `keep
this connection open for at most n seconds/minutes.` I'd prefer to avoid
polling the pg_stat_activity table to kill pids

Thanks!
-- 
View this message in context: http://www.nabble.com/Force-termination-of-an-idle-connection-tp25375135p25375135.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux