Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 884DF2E38F6 for ; Sat, 9 Feb 2008 19:50:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46527-01-7 for ; Sat, 9 Feb 2008 19:50:36 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 4441B2E4A4F for ; Sat, 9 Feb 2008 19:27:33 -0400 (AST) Received: from 219-89-39-126.dialup.xtra.co.nz ([219.89.39.126] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JNz6W-0001xx-5t; Sun, 10 Feb 2008 12:27:28 +1300 Message-ID: <47AE36DD.9050102@opencloud.com> Date: Sun, 10 Feb 2008 12:27:25 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Gregory Stark CC: Toru SHIMOGAKI , pgsql-jdbc@postgresql.org Subject: Re: proposal: setKeepAlive References: <47AC666C.9070704@oss.ntt.co.jp> <87abmb2weo.fsf@oxford.xeocode.com> <47AE2D07.50904@opencloud.com> <87zlu9k9c0.fsf@oxford.xeocode.com> In-Reply-To: <87zlu9k9c0.fsf@oxford.xeocode.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/30 X-Sequence-Number: 18237 Gregory Stark wrote: > The local case is precisely where you wouldn't want to use keep-alives. When > the server does come back up you'll get RSET packets and the connections will > die. This does assume that the server is not down because it's caught fire.. >> Keepalive helps a little but it's certainly not perfect. I ended up doing >> all the dead server detection at a higher level in the end. > > I think you're doing exactly what you have to do. You certainly don't want to > predicate failover on simple network reachability. You want to base it on the > application actually functioning. Network reachability is both too sensitive > (keep-alive packets could be dropped due to congestion) and not sensitive > enough (if the application crashes the host may still be reachable). For the environment I'm running in, network congestion sufficient to drop multiple keepalive packets is equivalent to server failure anyway. Agreed that you want application-level tests anyway, it's just that if there are network problems I would prefer to hear about them sooner rather than later - it seems a little silly to have the information available at the TCP level, but ignore it. You have to tune app-level timeouts to take account of the normal response time of the app, which might be quite different to the normal response time of the network. -O