From fhevia@ip-tel.com.ar Thu Jan 14 20:03:04 2010 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 01D006325DE for ; Thu, 14 Jan 2010 16:03:04 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 62736-04 for ; Thu, 14 Jan 2010 20:02:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from pyxis.powervt.com.ar (quportal.powervt.com.ar [190.11.152.66]) by mail.postgresql.org (Postfix) with ESMTP id 93CD4632771 for ; Thu, 14 Jan 2010 16:02:52 -0400 (AST) Received: from pcfhevia ([186.124.123.2]) by pyxis.powervt.com.ar (IPGroup Mail Server) with ASMTP id 1OT48953 for ; Thu, 14 Jan 2010 17:02:44 -0300 From: "Fernando Hevia" To: Subject: new server I/O setup Date: Thu, 14 Jan 2010 17:03:52 -0300 Organization: IP-TEL Message-ID: <3CD96C0AB4114484BFE358A3EDE61C01@iptel.com.ar> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0061_01CA953B.8C4EE430" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcqVVLFsurWpk+jQRvutD4rsy6b81A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.23 tagged_above=-10 required=5 tests=AWL=0.228, BAYES_50=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/304 X-Sequence-Number: 37184 This is a multi-part message in MIME format. ------=_NextPart_000_0061_01CA953B.8C4EE430 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi all, =20 I've just received this new server: 1 x XEON 5520 Quad Core w/ HT 8 GB RAM 1066 MHz 16 x SATA II Seagate Barracuda 7200.12 3ware 9650SE w/ 256MB BBU =20 It will run an Ubuntu 8.04 LTS Postgres 8.4 dedicated server. Its = database will be getting between 100 and 1000 inserts per second (those are call detail records of ~300 bytes each) of around 20 clients (voip gateways). Other activity is mostly read-only and some non time-critical writes generally at off peak hours. =20 So my first choice was: =20 2 discs in RAID 1 for OS + pg_xlog partitioned with ext2. 12 discs in RAID 10 for postgres data, sole partition with ext3. 2 spares =20 =20 My second choice is: =20 4 discs in RAID 10 for OS + pg_xlog partitioned with ext2 10 discs in RAID 10 for postgres, ext3 2 spares. =20 The bbu cach=E9 will be enabled for both raid volumes. =20 I justified my first choice in that WAL writes are sequentially and OS pretty much are too, so a RAID 1 probably would hold ground against a 12 disc RAID 10 with random writes. =20 I don't know in advance if I will manage to gather enough time to try = out both setups so I wanted to know what you guys think of these 2 = alternatives. Do you think a single RAID 1 will become a bottleneck? Feel free to = suggest a better setup I hadn't considered, it would be most welcome. =20 Pd: any clue if hdparm works to deactive the disks write cache even if = they are behind the 3ware controller? =20 Regards, Fernando. =20 ------=_NextPart_000_0061_01CA953B.8C4EE430 Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
Hi=20 all,
 
I've = just=20 received this new server:
1 x = XEON 5520 Quad=20 Core w/ HT
8 GB = RAM 1066=20 MHz
16 x = SATA II Seagate=20 Barracuda 7200.12
3ware = 9650SE w/=20 256MB BBU
 
It = will run an=20 Ubuntu 8.04 LTS Postgres 8.4 dedicated server. = Its database will=20 be getting between 100 and 1000 inserts per second (those are call = detail=20 records of ~300 bytes each) of around 20 clients (voip gateways). Other = activity=20 is mostly read-only and some non time-critical writes generally at = off peak=20 hours.
 
So=20 my=20 first choice was:
 
2 discs in RAID=20 1 for OS + pg_xlog partitioned with ext2.
12 = discs in RAID 10=20 for postgres data, sole partition with ext3.
2=20 spares
 
 
My = second choice=20 is:
 
4 = discs in RAID 10=20 for OS + pg_xlog partitioned with ext2
10 = discs in RAID 10=20 for postgres, ext3
2=20 spares.
 
The = bbu cach=E9 will=20 be enabled for both raid volumes.
 
I = justified my first=20 choice in that WAL writes are sequentially and OS pretty much are = too, so a=20 RAID 1 probably would hold ground against a 12 disc RAID 10 with = random=20 writes.
 
I = don't know in=20 advance if I will manage to gather enough time to try out both = setups so I=20 wanted to know what you guys think of these 2 alternatives. Do you = think a=20 single RAID 1 will become a bottleneck? Feel free to suggest a = better setup=20 I hadn't considered, it would be most welcome.
 
Pd: = any clue if=20 hdparm works to deactive the disks write cache even if they are = behind the=20 3ware controller?
 
Regards,
Fernando.
 
------=_NextPart_000_0061_01CA953B.8C4EE430-- From scott.marlowe@gmail.com Thu Jan 14 21:24:22 2010 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 09CDF63F838 for ; Thu, 14 Jan 2010 17:24:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 78192-02-5 for ; Thu, 14 Jan 2010 21:24:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mail.postgresql.org (Postfix) with ESMTP id 21F0863652F for ; Thu, 14 Jan 2010 17:22:10 -0400 (AST) Received: by fxm27 with SMTP id 27so1340694fxm.3 for ; Thu, 14 Jan 2010 13:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/1ciytZu2pvWSjZTfAGQ7H/rJ9LkjLBbnvBgj22tH/w=; b=pRqdQ5BO1keVi0Uk+jEExWiOJEW2Eo6W/nqsA+K6XVhQ0vtUY4CE11wkrS+MXVvwPu rGcnMBLc6W3jhhoo1pIIgpwNj+Fte5fTSEKk73KX7yKq+TkW53ZjCCB9lIKgs+SXkBZf DzJxywmEuTtTxkerJzgmMv5Py0tbODoQ1UykQ= 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=o8hsJPg6x+Ii1MILGtjKOveajCRCd8XRVGhKxHLz0f4um2nlHIEtyYgqyLnVAF5dzf b8y4uvN8oEGEjwSvpeDZgSUjKwzIk5fqXpcMMByQ21o0hXEtC7AwL20Xta0D0ajq/AY+ yvNzWV8NCh6PjzCBuMe3+Y79wVnLOpcncDRwM= MIME-Version: 1.0 Received: by 10.216.90.209 with SMTP id e59mr520594wef.193.1263504129122; Thu, 14 Jan 2010 13:22:09 -0800 (PST) In-Reply-To: <3CD96C0AB4114484BFE358A3EDE61C01@iptel.com.ar> References: <3CD96C0AB4114484BFE358A3EDE61C01@iptel.com.ar> Date: Thu, 14 Jan 2010 14:22:09 -0700 Message-ID: Subject: Re: new server I/O setup From: Scott Marlowe To: Fernando Hevia Cc: pgsql-performance@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=-2.48 tagged_above=-10 required=5 tests=AWL=0.119, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201001/310 X-Sequence-Number: 37190 On Thu, Jan 14, 2010 at 1:03 PM, Fernando Hevia wrot= e: > Hi all, > > I've just received=A0this new server: > 1 x XEON 5520 Quad Core w/ HT > 8 GB RAM 1066 MHz > 16 x SATA II Seagate Barracuda 7200.12 > 3ware 9650SE w/ 256MB BBU > > It will=A0run an Ubuntu=A08.04 LTS=A0Postgres 8.4 dedicated server. Its= =A0database > will be=A0getting between 100 and 1000 inserts per second (those are call > detail records of ~300 bytes each) of around 20 clients (voip gateways). > Other activity is mostly read-only and some non time-critical writes > generally=A0at off peak hours. > > So my first=A0choice was: > > 2=A0discs in RAID 1 for OS + pg_xlog partitioned with ext2. > 12 discs in RAID 10 for postgres data, sole partition with ext3. > 2 spares > > > My second choice is: > > 4 discs in RAID 10 for OS + pg_xlog partitioned with ext2 > 10 discs in RAID 10 for postgres, ext3 > 2 spares. > > The bbu cach=E9 will be enabled for both raid volumes. > > I justified my first choice in that WAL writes are=A0sequentially and OS > pretty much are too, so a RAID 1 probably would hold=A0ground against a 1= 2 > disc RAID 10 with random writes. I think your first choice is right. I use the same basic setup with 147G 15k5 SAS seagate drives and the pg_xlog / OS partition is almost never close to the same level of utilization, according to iostat, as the main 12 disk RAID-10 array is. We may have to buy a 16 disk array to keep up with load, and it would be all main data storage, and our pg_xlog main drive pair would be just fine. > I don't know in advance if I will manage to gather enough time to try out > both setups=A0so I wanted to know what you guys think of these 2 > alternatives.=A0Do you think a single RAID 1 will become=A0a bottleneck? = Feel > free to suggest a better setup I hadn't considered, it would be most > welcome. For 12 disks, most likely not. Especially since your load is mostly small randomish writes, not a bunch of big multi-megabyte records or anything, so the random access performance on the 12 disk RAID-10 should be your limiting factor. > Pd: any=A0clue if hdparm=A0works to deactive the disks write cache even i= f they > are behind the 3ware controller? Not sure, but I'm pretty sure the 3ware card already does the right thing and turns off the write caching. From greg@2ndquadrant.com Fri Jan 15 05:46:43 2010 Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4ED39632E61 for ; Fri, 15 Jan 2010 01:46:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 00787-04-3 for ; Fri, 15 Jan 2010 05:46:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id 49AAC634E77 for ; Fri, 15 Jan 2010 01:46:32 -0400 (AST) Received: from [192.168.1.3] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0Mfjsa-1NAqu73dqu-00NF6z; Fri, 15 Jan 2010 06:46:29 +0100 Message-ID: <4B500132.6050203@2ndquadrant.com> Date: Fri, 15 Jan 2010 00:46:26 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Fernando Hevia CC: pgsql-performance@postgresql.org Subject: Re: new server I/O setup References: <3CD96C0AB4114484BFE358A3EDE61C01@iptel.com.ar> In-Reply-To: <3CD96C0AB4114484BFE358A3EDE61C01@iptel.com.ar> Content-Type: multipart/alternative; boundary="------------030201010302090202000402" X-Provags-ID: V01U2FsdGVkX19VnWHhiY2DV+tgdPov15gVU4SYdQ9pIEDIuNe ePYHgS42130ZRs2SGE5zFFFyZ5RzriqqhORcpPZsn3B9QY7IDP KUtcLT2BqQcGf+5yOW7CA5gsgBi9y8F X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.427 tagged_above=-10 required=5 tests=AWL=0.171, BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201001/324 X-Sequence-Number: 37204 This is a multi-part message in MIME format. --------------030201010302090202000402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fernando Hevia wrote: > I justified my first choice in that WAL writes are sequentially and OS > pretty much are too, so a RAID 1 probably would hold ground against a > 12 disc RAID 10 with random writes. The problem with this theory is that when PostgreSQL does WAL writes and asks to sync the data, you'll probably discover all of the open OS writes that were sitting in the Linux write cache getting flushed before that happens. And that could lead to horrible performance--good luck if the database tries to do something after cron kicks off updatedb each night for example. I think there are two viable configurations you should be considering you haven't thought about: , but neither is quite what you're looking at: 2 discs in RAID 1 for OS 2 discs in RAID 1 for pg_xlog 10 discs in RAID 10 for postgres, ext3 2 spares. 14 discs in RAID 10 for everything 2 spares. Impossible to say which of the four possibilities here will work out better. I tend to lean toward the first one I listed above because it makes it very easy to monitor the pg_xlog activity (and the non-database activity) separately from everything else, and having no other writes going on makes it very unlikely that the pg_xlog will ever become a bottleneck. But if you've got 14 disks in there, it's unlikely to be a bottleneck anyway. The second config above will get you slightly better random I/O though, so for workloads that are really limited on that there's a good reason to prefer it. Also: the whole "use ext2 for the pg_xlog" idea is overrated far as I'm concerned. I start with ext3, and only if I get evidence that the drive is a bottleneck do I ever think of reverting to unjournaled writes just to get a little speed boost. In practice I suspect you'll see no benchmark difference, and will instead curse the decision the first time your server is restarted badly and it gets stuck at fsck. > Pd: any clue if hdparm works to deactive the disks write cache even if > they are behind the 3ware controller? You don't use hdparm for that sort of thing; you need to use 3ware's tw_cli utility. I believe that the individual drive caches are always disabled, but whether the controller cache is turned on or not depends on whether the card has a battery. The behavior here is kind of weird though--it changes if you're in RAID mode vs. JBOD mode, so be careful to look at what all the settings are. Some of these 3ware cards default to extremely aggressive background scanning for bad blocks too, you might have to tweak that downward too. -- Greg Smith 2ndQuadrant Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.com --------------030201010302090202000402 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Fernando Hevia wrote:
I justified my first choice in that WAL writes are sequentially and OS pretty much are too, so a RAID 1 probably would hold ground against a 12 disc RAID 10 with random writes.

The problem with this theory is that when PostgreSQL does WAL writes and asks to sync the data, you'll probably discover all of the open OS writes that were sitting in the Linux write cache getting flushed before that happens.  And that could lead to horrible performance--good luck if the database tries to do something after cron kicks off updatedb each night for example.

I think there are two viable configurations you should be considering you haven't thought about:
, but neither is quite what you're looking at:

2 discs in RAID 1 for OS
2 discs in RAID 1 for pg_xlog
10 discs in RAID 10 for postgres, ext3
2 spares.

14 discs in RAID 10 for everything
2 spares.

Impossible to say which of the four possibilities here will work out better.  I tend to lean toward the first one I listed above because it makes it very easy to monitor the pg_xlog activity (and the non-database activity) separately from everything else, and having no other writes going on makes it very unlikely that the pg_xlog will ever become a bottleneck.  But if you've got 14 disks in there, it's unlikely to be a bottleneck anyway.  The second config above will get you slightly better random I/O though, so for workloads that are really limited on that there's a good reason to prefer it.

Also:  the whole "use ext2 for the pg_xlog" idea is overrated far as I'm concerned.  I start with ext3, and only if I get evidence that the drive is a bottleneck do I ever think of reverting to unjournaled writes just to get a little speed boost.  In practice I suspect you'll see no benchmark difference, and will instead curse the decision the first time your server is restarted badly and it gets stuck at fsck.

Pd: any clue if hdparm works to deactive the disks write cache even if they are behind the 3ware controller?

You don't use hdparm for that sort of thing; you need to use 3ware's tw_cli utility.  I believe that the individual drive caches are always disabled, but whether the controller cache is turned on or not depends on whether the card has a battery.  The behavior here is kind of weird though--it changes if you're in RAID mode vs. JBOD mode, so be careful to look at what all the settings are.  Some of these 3ware cards default to extremely aggressive background scanning for bad blocks too, you might have to tweak that downward too.

-- 
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com
--------------030201010302090202000402--