Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6BB1264FFAE for ; Thu, 28 Aug 2008 16:46:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05408-06 for ; Thu, 28 Aug 2008 16:46:00 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.227]) by postgresql.org (Postfix) with ESMTP id 6E35864FD3B for ; Thu, 28 Aug 2008 16:46:02 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so689529rvf.43 for ; Thu, 28 Aug 2008 12:46:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=nB/3WMBf4Xwctt7qaK1HVqpLtH2Xx3Al2jvmVnxuBJQ=; b=erN/A9TZVGdM0W9FryfRz5qHNFIMLpF1/Csjy2pStISX/3lRyxTh7lbprqzCt9G6PF WcSB9yV3Au9ySbbS3kmHnAaC1OjEUXH8Kj1zZae/BarE1QVN0jcGsHkeA0ycdYHcGTXr S8LRqwhrSlQf18v23JfWEphs0U6DOEU4y0n/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=VK6kzVxl3MNZDVzLq55BL8nKJW7fKlNWZQCXQZFE3r7reoiu+zPEmmqCHeJ/L6kOtQ iBQZqp8ifT7ms9QaybWaQGz5MxDP4cKrfY+opyj2D+CQ6qvQtbC0Hs4UIaqniqTM4Em/ ovQan6Yqhg2ftvUZQsRpPBUmv1E7BISyGlO9A= Received: by 10.140.147.5 with SMTP id u5mr996111rvd.166.1219952761096; Thu, 28 Aug 2008 12:46:01 -0700 (PDT) Received: by 10.141.197.1 with HTTP; Thu, 28 Aug 2008 12:46:01 -0700 (PDT) Message-ID: Date: Thu, 28 Aug 2008 13:46:01 -0600 From: "Scott Marlowe" To: cluster Subject: Re: Best hardware/cost tradoff? Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/385 X-Sequence-Number: 31266 On Thu, Aug 28, 2008 at 1:22 PM, cluster wrote: > I'm about to buy a combined web- and database server. When (if) the site > gets sufficiently popular, we will split the database out to a separate > server. > > Our budget is limited, so how should we prioritize? Standard prioritization for a db server is: Disks and controller, RAM, CPU. > * We think about buying some HP Proliant server with at least 4GB ram and at > least a duo core processor. Possibly quad core. The OS will be debian/Linux. HP Makes nice equipment. Also, since this machine will have apache as well as pgsql running on it, you might want to look at more memory if it's reasonably priced. If pg and apache are using 1.5Gig total to run, you've got 2.5Gig for the OS to cache in. With 8 Gig of ram, you'd have 6.5Gig to cache in. Also, the cost of a quad core nowadays is pretty reasonable. > * Much of the database will fit in RAM so it is not *that* necessary to > prefer the more expensive SAS 10000 RPM drives to the cheaper 7500 RPM SATA > drives, is it? That depends. Writes will still have to hit the drives. Reads will be mostly from memory. Be sure to set your effective_cache_size appropriately. > There will both be many read- and write queries and a *lot* > (!) of random reads. > > * I think we will go for hardware-based RAID 1 with a good battery-backed-up > controller. The HP RAID controller that's been mentioned on the list seems like a good performer. > I have read that software RAID perform surprisingly good, but > for a production site where hotplug replacement of dead disks is required, > is software RAID still worth it? The answre is maybe. The reason people keep testing software RAID is that a lot of cheap (not necessarily in cost, just in design) controllers give mediocre performance compared to SW RAID. With SW RAID on top of a caching controller in jbod mode, the controller simply becomes a cache that can survive power loss, and doesn't have to do any RAID calculations any more. With today's very fast CPUs, and often running RAID-10 for dbs, which requires little real overhead, it's not uncommon for SW RAID to outrun HW. With better controllers, the advantage is small to none. > Anything else we should be aware of? Can you go with 4 drives? Even if they're just SATA drives, you'd be amazed at what going from a 2 drive mirror to a 4 drive RAID-10 can do for your performance. Note you'll have no more storage going from 2 drive mirror to 4 drive RAID-10, but your aggregate bandwidth on reads will be doubled.