Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1egDIB-0002nT-9x for pgsql-general@arkaria.postgresql.org; Mon, 29 Jan 2018 17:32:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egDI9-0003xI-WE for pgsql-general@arkaria.postgresql.org; Mon, 29 Jan 2018 17:32:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1egDI9-0003x9-HB for pgsql-general@lists.postgresql.org; Mon, 29 Jan 2018 17:32:25 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1egDI6-0004mk-2G for pgsql-general@lists.postgresql.org; Mon, 29 Jan 2018 17:32:24 +0000 Received: by mail-wr0-x243.google.com with SMTP id 16so8097267wry.12 for ; Mon, 29 Jan 2018 09:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=dP8oZtEV0ihj/IY/4EbXyk82RGYwltdvtLw82xTnQGI=; b=xN9sFbIsgSmNnfWH0i2EUgFrypZJhGM8wKQkS8NfS/ArYFN0bvAjSYS/F/p2PTXBvO o1vitstfyr9ORh1876ccZzV7qek3yVj2EQhxv0hionlZvL3YMeSzs1VPXAksNRZYPPF2 SJVRsBTaoI4tPb4r4/PnUlS1lm3uj+TfrOkJYlQ6MzdtD/+bh1Qt0LaGoz2J3oHQic7N x4IG0Esf3AF4IYm0AljiIifo9jFSQGtsr5x4E701Rz6FB9OKOeeElclrJqsutRHN5QOW aTmF7QT/0PRV44kNIhJOoqaT9NszeEMPi6Ywg2LNNyPCUeOH8apF3AcL8ijhrEMa3qWr cZqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dP8oZtEV0ihj/IY/4EbXyk82RGYwltdvtLw82xTnQGI=; b=YaT3745CqMe69Fqk55G19C5LVbwTUuRfT+BtbRXZx6fQV48wcsBms+aQsDFaIj5F3T nP1rw9/J1E+jfa+Ht5VtS2LBm26VoH0v7KjHVYOSvulOBNk0ZeSOcU+/Zbn+l4KDwwqU soXHOEs0Y9NLfOq6pHrMuTDIIgn97eS5UFPUg/OrecTswYT9dKFJInt85P1fumy1XtPr JPP0V1CyjxZ6OhJU720FS07jdlnu1aNcsrxqkTRs/4W1yodeLGxj16yGdPY7jkN2Bp5T tH2E/3TH/MfF78DIOJQsjN6VyETVd+ga5QYl0ginPwHRg0//baXt2fztOqro3K/p4Za6 IA/g== X-Gm-Message-State: AKwxytc22pRqA2cRXeaRaMi+I9h6J2NeCIy+7wIYrrCo/IesWqiq/eQI RJYHaY2UnyZxZxHw5/5fGELz6/XaFrgCKZUAXlNIBiI7rse2rsZ67Htzih4B5UVeYWPRy3jbJXN 41RVvKsFmGcQMfL1mZl8am7T5arEGnBRBCkBvzjrv4UJoNWEqSlrpwLRvLFlF6jvjLV2dxxb3uz 16kfHKsDFjIvb28f6h X-Google-Smtp-Source: AH8x224JWP/IuOs153QI9oAPGJ2Cylh1WZtAc7J7Wn3PsDrGqwZlK8uaDySjiGEwshMEG26RFNLAfw== X-Received: by 10.223.134.45 with SMTP id 42mr20075882wrv.218.1517247139588; Mon, 29 Jan 2018 09:32:19 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id k7sm12992199wrg.38.2018.01.29.09.32.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 09:32:18 -0800 (PST) Subject: Re: Using AWS ephemeral SSD storage for production database workload? To: Pritam Barhate , pgsql-general@lists.postgresql.org References: From: Tomas Vondra Message-ID: Date: Mon, 29 Jan 2018 18:32:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/29/2018 05:41 PM, Pritam Barhate wrote: > Hi everyone,  > > As you may know, EBS volumes though durable are very costly when you > need provisioned IOPS. As opposed to this AWS instance attached > ephemeral SSD is very fast but isn't durable. > > I have come across some ideas on the Internet where people hinted at > running production PostgreSQL workloads on AWS ephemeral SSD > storage. Generally, this involves shipping WAL logs continuously to > S3 and keeping an async read replica in another AWS availability > zone. Worst case scenario in such deployment is data loss of a few > seconds. But beyond this the details are sketchy. > Both log shipping and async replication are ancient features, and should be well understood. What exactly is unclear? > Have you come across such a deployment? What are some best practices > that need to be followed to pull this through without significant > data loss? Even though WAL logs are being shipped to S3, in case of > loss of both the instances, the restore time is going be quite a bit > for databases of a few hundred GBs. > Pretty much everyone who is serious about HA is running such cluster. If they can't afford any data loss, they use synchronous replicas instead. That's a basic latency-durability trade-off. > Just to be clear, I am not planning anything like this, anytime soon > :-) But I am curious about trade-offs of such a deployment. Any > concrete information in this aspect is well appreciated. > Pretty much everyone is using such architecture (primary + streaming replicas) nowadays, so it's a reasonably well understood scenario. But it's really unclear what kind of information you expect to get, or how much time have you spent reading about this. There is quite a bit of information in the official docs, although maybe a bit too low level - it certainly gives you the building blocks instead of a complete solution. There are also books like [1] for example. And finally there are tools that help with managing such clusters, like for example [2]. Not only it's rather bad idea to implement this on your own (bugs, unnecessary effort) but the tools also show how to do stuff. [1] https://www.packtpub.com/big-data-and-business-intelligence/postgresql-replication-second-edition [2] https://repmgr.org/ regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services