]> granicus.if.org Git - pgbouncer/commitdiff
Turn on tcp_keepalive by default.
authorMarko Kreen <markokr@gmail.com>
Fri, 25 Mar 2011 21:55:03 +0000 (23:55 +0200)
committerMarko Kreen <markokr@gmail.com>
Fri, 25 Mar 2011 21:55:03 +0000 (23:55 +0200)
This gives pgbouncer same behaviour as Postgres,
as Postgres does it unconditionally.

Noticed by Hubert Depesz Lubaczewski.

doc/config.txt
etc/pgbouncer.ini
src/main.c

index 95dcd6256425ac0266d2ce7f934284629ad1c033..10faebc7b933bca1515d5d9f283553c57b1d1fa9 100644 (file)
@@ -395,7 +395,12 @@ Default: not set
 
 ==== tcp_keepalive ====
 
-Default: not set
+Turns on basic keepalive with OS defaults.
+
+On Linux, the system defaults are tcp_keepidle=7200, tcp_keepintvl=75,
+tcp_keepcnt=9.  They are probably similar on other OS-es.
+
+Default: 1
 
 ==== tcp_keepcnt ====
 
index cc53b8c66f6c719028da33d26b7fd69e84187c7a..e3c452d3250f9ae5a62f1d3e1ca492a84212d8aa 100644 (file)
@@ -182,7 +182,7 @@ log_pooler_errors = 1
 ;tcp_socket_buffer = 0
 
 ;; whether tcp keepalive should be turned on (0/1)
-;tcp_keepalive = 0
+;tcp_keepalive = 1
 
 ;; following options are linux-specific.
 ;; they also require tcp_keepalive=1
index da0c12146f9a010bdbeae395f154d7e0dbbb85fd..b7597a73762ee16e372fad9a9b0093c5c2bc867f 100644 (file)
@@ -202,7 +202,7 @@ CF_ABS("pkt_buf", CF_INT, cf_sbuf_len, CF_NO_RELOAD, "2048"),
 CF_ABS("sbuf_loopcnt", CF_INT, cf_sbuf_loopcnt, 0, "5"),
 CF_ABS("tcp_defer_accept", DEFER_OPS, cf_tcp_defer_accept, 0, NULL),
 CF_ABS("tcp_socket_buffer", CF_INT, cf_tcp_socket_buffer, 0, "0"),
-CF_ABS("tcp_keepalive", CF_INT, cf_tcp_keepalive, 0, "0"),
+CF_ABS("tcp_keepalive", CF_INT, cf_tcp_keepalive, 0, "1"),
 CF_ABS("tcp_keepcnt", CF_INT, cf_tcp_keepcnt, 0, "0"),
 CF_ABS("tcp_keepidle", CF_INT, cf_tcp_keepidle, 0, "0"),
 CF_ABS("tcp_keepintvl", CF_INT, cf_tcp_keepintvl, 0, "0"),