Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D3E561A9F00B for ; Wed, 16 Nov 2011 13:32:13 -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 24891-07 for ; Wed, 16 Nov 2011 17:32:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 089FD1A9F00A for ; Wed, 16 Nov 2011 13:32:08 -0400 (AST) Received: from mail-pz0-f44.google.com ([209.85.210.44]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQjLD-0006AP-6P for pgsql-performance@postgresql.org; Wed, 16 Nov 2011 17:32:07 +0000 Received: by pzk33 with SMTP id 33so38225175pzk.3 for ; Wed, 16 Nov 2011 09:31:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:x-priority:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=C/nFdIGJ2RzZ2h8C5JbxsAPSk8gSTuy+md6NgVXeKJ4=; b=sJXwzx4dfgtg6hRtBHvNXj70RZY6bx9mHzAQ/9EyqRQSOBgYQkTNUNj66npVFqoT7o O7JaMQd3Jh8b0GFxBrc/oE37wjLGU/CwIUdPMqvgkSfL+yI9L2ZCDvCGAA8MZaFwtd39 MtmxvHTCglINVn2KFaFO35bd16T20y4nNeBx0= Received: by 10.50.100.232 with SMTP id fb8mr28042501igb.8.1321464714486; Wed, 16 Nov 2011 09:31:54 -0800 (PST) Received: from [10.0.0.26] (50-0-80-184.dsl.static.sonic.net. [50.0.80.184]) by mx.google.com with ESMTPS id ew6sm25763662igc.4.2011.11.16.09.31.51 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Nov 2011 09:31:52 -0800 (PST) Subject: Re: Slow queries / commits, mis-configuration or hardware issues? Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Cody Caughlan X-Priority: 3 (Normal) In-Reply-To: <90891b62c1ea76f6e599616055e9cf88.squirrel@sq.gransy.com> Date: Wed, 16 Nov 2011 09:31:50 -0800 Cc: pgsql-performance@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <60F36E9C-9BBE-442F-9027-EEC5DCAB2C42@gmail.com> References: <87e450fd65045c328f41e1b99a4029d5.squirrel@sq.gransy.com> <4EC30F05.6010901@fuzzy.cz> <90891b62c1ea76f6e599616055e9cf88.squirrel@sq.gransy.com> To: Tomas Vondra X-Mailer: Apple Mail (2.1251.1) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201111/197 X-Sequence-Number: 45708 On Nov 16, 2011, at 8:52 AM, Tomas Vondra wrote: > On 16 Listopad 2011, 2:21, Cody Caughlan wrote: >> How did you build your RAID array? Maybe I have a fundamental flaw / >> misconfiguration. I am doing it via: >>=20 >> $ yes | mdadm --create /dev/md0 --level=3D10 -c256 --raid-devices=3D4 >> /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde >> $ pvcreate /dev/md0 >> $ vgcreate lvm-raid10 /dev/md0 >> $ lvcreate -l 215021 lvm-raid10 -n lvm0 >> $ blockdev --setra 65536 /dev/lvm-raid10/lvm0 >> $ mkfs.xfs -f /dev/lvm-raid10/lvm0 >> $ mkdir -p /data && mount -t xfs -o noatime /dev/lvm-raid10/lvm0 = /data >=20 > I'm not using EC2 much, and those were my first attempts with = ephemeral > storage, so this may be a stupid question, but why are you building a > RAID-10 array on an ephemeral storage, anyway? >=20 > You already have a standby, so if the primary instance fails you can > easily failover. >=20 Yes, the slave will become master if master goes down. We have no plan = to try and resurrect the master in the case of failure, hence the choice = of ephemeral vs EBS.=20 We chose RAID10 over RAID0 to get the best combination of performance = and minimizing probability of a single drive failure bringing down the = house. So, yes, RAID0 would ultimately deliver the best performance, with more = risk. > What are you going to do in case of a drive failure? With a server = this is > rather easy - just put there a new drive and you're done, but can you = do > that on EC2? I guess you can't do that when the instance is running, = so > you'll have to switch to the standby anyway, right? Have you ever = tried > this (how it affects the performance etc.)? >=20 As far as I know one cannot alter the ephemeral drives in a running = instance, so yes, the whole instance would have to be written off. > So what additional protection does that give you? Wouldn't a RAID-0 be = a > better utilization of the resources? >=20 Too much risk. > Tomas >=20