Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRxX5-0005nV-Ve for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 07:11:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZRxX5-0006vh-GZ for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 07:11:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZRxVn-0005Qe-Rs for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 07:10:15 +0000 Received: from wagner.pp.ru ([178.63.209.18] helo=mx.wagner.pp.ru) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZRxVl-0002JH-Gq for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 07:10:15 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id CF96E48616F for ; Wed, 19 Aug 2015 10:10:12 +0300 (MSK) Received: from wagner.pp.ru (wifi [192.168.217.63]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id F3A80211F1 for ; Wed, 19 Aug 2015 10:10:10 +0300 (MSK) Date: Wed, 19 Aug 2015 10:10:09 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Proposal: Implement failover on libpq connect level. Message-ID: <20150819071009.GC31302@wagner.pp.ru> References: <20150818041850.GA5092@wagner.pp.ru> <20150819.124245.1322750734243127189.t-ishii@sraoss.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150819.124245.1322750734243127189.t-ishii@sraoss.co.jp> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2015.08.19 at 12:42:45 +0900, Tatsuo Ishii wrote: > I wonder how extended protocol is handled by this proposal. Suppose > load balacing mode is enabled. PQprepare is executed on standby1. Then > PQexecPrepared gets called. This may be executed on standby2, which > will fail because there's no prepared statement created by the former > PQprepare call. Here we are discussing load-balancing on the client level, not on the statement level. Suppose that we have 100 readonly clients and 3 standby servers + master. If all clients specify all four servers in the their connect strings, and connect randomly to them, each server would have approximately 25 clients. But once connection is established, each client works with one server (at least until communication failure occurs and it would call PQreset. In this case it has to reprepare statements anyway). -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers