psycopgwrapper: Activate TCP keepalive on database connections
authorMarko Kreen <markokr@gmail.com>
Tue, 24 Nov 2009 13:55:09 +0000 (15:55 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 24 Nov 2009 13:55:09 +0000 (15:55 +0200)
commit0e00bd1e946f0b2153b24bda460b345be0aa79f9
treece8b9795223a593d5f90805aa5648b39acaa827f
parentb269094eae644b6bf6843a7933ec5cb60125ce31
psycopgwrapper: Activate TCP keepalive on database connections

Turn on keepalive by default, to avoid hanged scripts in case of
network problems.

Also tune the keepalive timeouts smaller, on Linux at least,
so that the error happens after 5 min blackout.
(4 min idle + 4x15sec keepalive pings)
python/skytools/psycopgwrapper.py