Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 000341337B4A for ; Tue, 18 Jan 2011 15:17:25 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 23767-04 for ; Tue, 18 Jan 2011 19:17:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marajade.localdomain (vcs5.camavision.com [63.228.164.252]) by mail.postgresql.org (Postfix) with ESMTP id 98AEE1337B63 for ; Tue, 18 Jan 2011 15:17:18 -0400 (AST) Received: from [192.168.10.84] (unknown [192.168.10.84]) (Authenticated sender: andy) by marajade.localdomain (Postfix) with ESMTPA id D417542FDD; Tue, 18 Jan 2011 13:17:17 -0600 (CST) Message-ID: <4D35E743.60603@squeakycode.net> Date: Tue, 18 Jan 2011 13:17:23 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Lars CC: "pgsql-performance@postgresql.org" Subject: Re: Migrating to Postgresql and new hardware References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: 201101/152 X-Sequence-Number: 41939 On 1/18/2011 4:56 AM, Lars wrote: > Hi, > > We are in the process of moving a web based application from a MySql > to Postgresql database. Our main reason for moving to Postgresql is > problems with MySql (MyISAM) table locking. We will buy a new set of > servers to run the Postgresql databases. > > The current setup is five Dell PowerEdge 2950 with 2 * XEON E5410, > 4GB RAM. PERC 5/I 256MB NV Cache, 4 * 10K Disks (3 in RAID 5 + 1 > spare). > > One server is used for shared data. Four servers are used for sharded > data. A user in the system only has data in one of the shards. There > is another server to which all data is replicated but I'll leave that > one out of this discussion. These are dedicated database servers. > There are more or less no stored procedures. The shared database size > is about 20GB and each shard database is about 40GB (total of 20 + 40 > * 4 = 180GB). I would expect the size will grow 10%-15% this year. > Server load might increase with 15%-30% this year. This setup is disk > I/O bound. The overwhelming majority of sql statements are fast > (typically single row selects, updates, inserts and deletes on > primary key) but there are some slow long running (10min) queries. > No idea what mysql thinks a shard is, but in PG we have read-only hot standby's. The standby database is exactly the same as the master (save a bit of data that has not been synced yet.) I assume you know this... but I'd really recommend trying out PG's hot-standby and make sure it works the way you need (because I bet its different than mysql's). Assuming the "shared" and the "sharded" databases are totally different (lets call them database a and c), with the PG setup you'd have database a on one computer, then one master with database b on it (where all writes go), then several hot-standby's mirroring database b (that support read-only queries). As for the hardware, you'd better test it. Got any old servers you could put a real-world workload on? Or just buy one new server for testing? Its pretty hard to guess what your usage pattern is (70% read, small columns, no big blobs (like photos), etc)... and even then we'd still have to guess. I can tell you, however, having your readers and writers not block each other is really nice. Not only will I not compare apples to oranges, but I really wont compare apples in Canada to oranges in Japan. :-) -Andy