Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C590A1337BA3 for ; Sun, 24 Apr 2011 20:31:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 15785-08 for ; Sun, 24 Apr 2011 23:31:32 +0000 (UTC) X-Greylist: delayed 00:05:40.891337 by SQLgrey-1.7.6 Received: from smtp112.dfw.emailsrvr.com (smtp112.dfw.emailsrvr.com [67.192.241.112]) by mail.postgresql.org (Postfix) with ESMTP id 08893133616B for ; Sun, 24 Apr 2011 20:31:30 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp21.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 857FE24031F for ; Sun, 24 Apr 2011 19:25:48 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp21.relay.dfw1a.emailsrvr.com (Authenticated sender: cernst-AT-zvelo.com) with ESMTPSA id 61FB3240373 for ; Sun, 24 Apr 2011 19:25:48 -0400 (EDT) Message-ID: <4DB4B17A.4060502@zvelo.com> Date: Sun, 24 Apr 2011 17:25:46 -0600 From: Chris Ernst Organization: Zvelo, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110419 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Scaling References: In-Reply-To: X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/224 X-Sequence-Number: 37405 On 04/24/2011 04:21 PM, David Hornsby wrote: > My SMB database is currently running on a HP-UX box running in a master > - slave slonyI cluster to create a hot spare database. Recently the > server has be getting hammered and we are consistently hitting our max > db connections. We have our web CMS and our web apps, our desktop client > apps, and a couple application servers running off of this database > server and it is crumbling under the stress. Currently we have been > doing table partitioning and table archiving to trim the fat off of the > indexing processes etc. > > My project at hand is to upgrade this configuration to a linux cluster > of servers, 2 - 3. The ideal solution is to just do load balancing > through DNS requests and have 2 servers in a multi master configuration. > So far we have not had any hardware issues on our current set up ( knock > on wood). So in doing this I am not immediately looking for a hot spare > set up. But in the future am looking at setting up a VPN tunnel to an > offsite server and sending WAL updates to that. > > Any and all comments are truly appreciated as well as any nudges in > various directions. I'm not aware of any production ready multi-master solution for PostgreSQL. So I would not suggest perusing that at the moment. If your primary problem is hitting your max db connections (and the performance degradation that goes along with that), I would suggest looking in to connection pooling. This will allow you to cap the number of connections without just rejecting connections and will enable you to dedicate more resources to each of the active connections. Ultimately, your overall throughput should increase. pgbouncer is very easy to set up and is great if you want simple pooling. pgpool is is also a great pooler and a lot more (e.g. load balancing, horizontal scaling, etc), but is a bit more complex to set up. - Chris