Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5ajf-00069A-Kk for pgsql-performance@arkaria.postgresql.org; Sun, 17 Mar 2019 18:42:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h5aje-0008SX-Ad for pgsql-performance@arkaria.postgresql.org; Sun, 17 Mar 2019 18:42:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5ajd-0008SQ-Oy for pgsql-performance@lists.postgresql.org; Sun, 17 Mar 2019 18:42:14 +0000 Received: from gproxy10-pub.mail.unifiedlayer.com ([69.89.20.226]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h5aja-0005q1-FO for pgsql-performance@lists.postgresql.org; Sun, 17 Mar 2019 18:42:11 +0000 Received: from cmgw12.unifiedlayer.com (unknown [10.9.0.12]) by gproxy10.mail.unifiedlayer.com (Postfix) with ESMTP id 940D314041C for ; Sun, 17 Mar 2019 12:42:07 -0600 (MDT) Received: from host214.hostmonster.com ([74.220.215.214]) by cmsmtp with ESMTP id 5ajXhGrUsmds95ajXh0vMl; Sun, 17 Mar 2019 12:42:07 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=pragmaticdata.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=BhXU1BK+g01O1+B3RlXMWEXZUUe2lUlpBS5h1sa8fYc=; b=GOB2sL1+M61e1epT8o3yR5YWnP rTsxUZCXeouSNdwEskhk7akMDyRVT7FXbeqMuqwODSvJkyLR8PWCGRPQY/dvh0dLXm3Y/3eI+fFcJ awTeLU3gwNp7v1u0JdY1oVD8Z; Received: from [45.164.1.33] (port=53838 helo=[192.168.9.8]) by host214.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1h5ajX-002IbU-2I; Sun, 17 Mar 2019 12:42:07 -0600 Subject: Re: Distributing data over "spindles" even on AWS EBS, (followup to the work queue saga) To: Jeremy Schneider , pgsql-performance@lists.postgresql.org References: <679375f7-bb61-6a66-e91a-4b5454f9223b@gusw.net> From: Gunther Message-ID: <74d58c5d-2e56-781d-4bbc-b122ce3e6020@gusw.net> Date: Sun, 17 Mar 2019 14:42:04 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host214.hostmonster.com X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gusw.net X-BWhitelist: no X-Source-IP: 45.164.1.33 X-Source-L: No X-Exim-ID: 1h5ajX-002IbU-2I X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.9.8]) [45.164.1.33]:53838 X-Source-Auth: gunther+pragmaticdata.com X-Email-Count: 2 X-Source-Cap: cHJhZ21hdDE7cHJhZ21hdDE7aG9zdDIxNC5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: yes List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/14/2019 11:11, Jeremy Schneider wrote: > On 3/14/19 07:53, Gunther wrote: >> 2. build a low level "spreading" scheme which is to take the partial >> files 4653828 and 4653828.1, .2, _fsm, etc. and move each to another >> device and then symlink it back to that directory (I come back to this!) > ... >> To 2. I find that it would be a nice feature of PostgreSQL if we could >> just use symlinks and a symlink rule, for example, when PostgreSQL finds >> that 4653828 is in fact a symlink to /otherdisk/PG/16284/4653828, then >> it would >> >> * by default also create 4653828.1 as a symlink and place the actual >> data file on /otherdisk/PG/16284/4653828.1 > How about if we could just specify multiple tablespaces for an object, > and then PostgreSQL would round-robin new segments across the presently > configured tablespaces? This seems like a simple and elegant solution > to me. Very good idea! I agree. Very important also would be to take out the existing patch someone had contributed to allow toast tables to be assigned to different tablespaces. >> 4. maybe I can configure in AWS EBS to reserve more IOPS -- but why >> would I pay for more IOPS if my cost is by volume size? I can just >> make another volume? or does AWS play a similar trick on us with >> IOPS being limited on some "credit" system??? > Not credits, but if you're using gp2 volumes then pay close attention to > how burst balance works. A single large volume is the same price as two > striped volumes at half size -- but the striped volumes will have double > the burst speed and take twice as long to refill the burst balance. Yes, I learned that too. It seems a very interesting "bug" of the Amazon GP2 IOPS allocation scheme.  They say it's like 3 IOPS per GiB, so if I have 100 GiB I get 300 IOPS. But it also says minimum 100. So that means if I have 10 volumes of 10 GiB each, I get 1000 IOPS minimum between them all. But if I have it all on one 100 GiB volume I only get 300 IOPS. I wonder if Amazon is aware of this. I hope they are and think that's just fine. Because I like it. It also is a clear sign to me that I want to use page sizes > 4k for the file system. I have tried on Amazon Linux to use 8k block sizes of the XFS volume, but I cannot mount those, since the Linux says it can currently only deal with 4k blocks. This is another reason I consider switching the database server(s) to FreeBSD.  OTOH, who knows may be this 4k is a limit of the AWS EBS infrastructure. After all, if I am scraping the 300 or 1000 IOPS limit already and if I can suddenly upgrade my block sizes per IO, I double my IO throughput. regards, -Gunther