Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id D85336330F7 for ; Thu, 13 May 2010 23:45:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 88041-02 for ; Fri, 14 May 2010 02:45:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f179.google.com (mail-yx0-f179.google.com [209.85.210.179]) by mail.postgresql.org (Postfix) with ESMTP id F1345632FEB for ; Thu, 13 May 2010 23:45:52 -0300 (ADT) Received: by yxe9 with SMTP id 9so976476yxe.29 for ; Thu, 13 May 2010 19:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HGj1mGY+UOpWGPXihQnHGwnseUT8xGIKU3v+7eXPwhU=; b=tmBBXZwVddNRHaH3iUGSATYn6OqoMv9DUYtzW6j4KvbZfPIJVxdjsWK3Tfrz7UhdPI 3p3byLUdhC97lwz1laaQKOtZul+1sKkyAwYxnClv+Mv6MjC12V559Z0EeArUIZ+qVCON 6nvaOSD1e8r30DgtxvrZNss6HtyKnNZqwaNqw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rtSk7jq7uzZZ37QrMVLa16AGaS1r6dTkX7IhN21qg/0sHHpeEseta+BqaimGu8SoD/ 2DK4jRfhGtxSrX7bfzJ/PIyiHUGgElQ6393MnBM0wpp383apAfzZFAipd8S8DVsPnn2k z4eyN9JWaaoLsSwN1wTvwNKV3uoNIph++iiTM= MIME-Version: 1.0 Received: by 10.150.233.8 with SMTP id f8mr1030438ybh.248.1273805150604; Thu, 13 May 2010 19:45:50 -0700 (PDT) Received: by 10.150.185.5 with HTTP; Thu, 13 May 2010 19:45:50 -0700 (PDT) In-Reply-To: References: Date: Thu, 13 May 2010 20:45:50 -0600 Message-ID: Subject: Re: Advice on HA/LB setup for small installation From: Scott Marlowe To: Jamie Tufnell Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-10 required=5 tests=BAYES_20=-0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/144 X-Sequence-Number: 34617 On Thu, May 13, 2010 at 8:15 PM, Jamie Tufnell wrot= e: > Hi, > > We have a webapp backed by a single PostgreSQL server and I'd like to > add a second primarily for availability. =A0I figure if we can load > balance reads too then why not. > > Having read over the HA docs/matrix, I'm considering using 9.0's hot > standby with pgpool-II to automatically balance reads without having > to adjust our webapp to split the reads/writes. > > Firstly, is this a sound setup and does anyone using it have any > comments fore/against, gotchas? Well, it's new and shiny, and not a lot of people are running it yet since it's still in beta. I'd suggest being a beta tester on it and reporting problems, cause now's the time to do it. > Secondly, is there a companion tool to achieve this with pgbouncer? > Note I have nothing against pgpool, just curious as we're already > using pgbouncer in production. slony? Both are asynchronous, so some lag is to be expected. When slony runs out of disk bandwidth it starts to fall behind. You can put slony sl_log_x on a separate tablespace and that helps, but that's it's limit to keeping up. I'm not sure what latency to expect from PITR. We get 5 to 20 seconds under heavy load with slony generally. With occasional spikes late at night when we run backups / maintenance processes into the 30 to 60 second range.