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 1ejIVC-0005RJ-HM for pgsql-performance@arkaria.postgresql.org; Wed, 07 Feb 2018 05:42:38 +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 1ejIV9-0006pA-OL for pgsql-performance@arkaria.postgresql.org; Wed, 07 Feb 2018 05:42:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ejIV9-0006p1-D3 for pgsql-performance@lists.postgresql.org; Wed, 07 Feb 2018 05:42:35 +0000 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ejIV6-0008Ab-12 for pgsql-performance@lists.postgresql.org; Wed, 07 Feb 2018 05:42:34 +0000 Received: by mail-io0-x232.google.com with SMTP id 72so687002iom.10 for ; Tue, 06 Feb 2018 21:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :in-reply-to:user-agent; bh=mjvDEh7BhgcO5GoRo6p5TxtOoeAkslvSSeo2gyAITF0=; b=NnWMHODfQCRUnVnZzleUId+IZ7vhItQp8eedlI6puCjYLIlU9xyzvEQGbhSD9vBacb iRCCc7IKNAaw/h3iFZUN1dEnjAGTuc0Z3wY/IQtwacVcm/qcEUeJ4vGsEEj4VihCVy2X N3tpArFnakjH/wRkJiyDO4gcEBx17OJAYeeaTj1wh/doXly066iNowgg0I32hSgVkRUq Qg6ZZSNGixBvBC8732Bt9f/+dk73F4AggsIqbqDE3xvBITzH0roDSWugAKZpW2iE5P99 3uzpD+u/uzggaqF6MrOdGskGpvzpLtEzB28/FZcB/k7roLtvPx3oPGOBZTECCDT13LNF RYWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:in-reply-to:user-agent; bh=mjvDEh7BhgcO5GoRo6p5TxtOoeAkslvSSeo2gyAITF0=; b=qmTwUlp02E8DcQx/c3zPB4/mxeWyynQP+ABUt+K4f+IrVb/qWcUOOjK5P8STjBMBId f6zY2F3NdgA32XypviMxyeIyBaPA3SN1auZXk0/cW4m1GMSs0sLKPbgZ+06dUhwPN8gH /HChJmxSrrbCQVG6cBU831tHQcRJ+cyYe3RZZhkNOXc8p9bQPtBmK6wCoI2OqJF0IsXT UkPC4ijTvcMS+7BFDiafrs5U5sRSoNjsCfQqDLheQITVvcPAN7vZ7YE8MfWnfjnkqQ/9 bf5Jk4jTJQ3NyHzcJEE0H9jGF0KUBOkXcA1iZkXbcTpWA03vhO3ofFQMVS4ck1507qCe kDIQ== X-Gm-Message-State: APf1xPDIuAdy23bqwLIUIlF8/snO1k0Amsts+Ve1nrXARFufnv0ovSXL weLQCyprEgIca93rhhNPjmKGsA== X-Google-Smtp-Source: AH8x227wjqbKoFnobYNY44n6GMxg/llrUW9a7rhl0V/qyq882CqveTpAHhR36TToXX3a1OXYXFyF8w== X-Received: by 10.107.166.76 with SMTP id p73mr6280071ioe.158.1517982148942; Tue, 06 Feb 2018 21:42:28 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m34sm879314iti.24.2018.02.06.21.42.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 21:42:28 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 85CA380100E; Tue, 6 Feb 2018 23:42:27 -0600 (CST) Date: Tue, 6 Feb 2018 23:42:27 -0600 From: Justin Pryzby To: Claudio Freire Cc: Vitaliy Garnashevich , Gary Doades , Rick Otten , pgsql-performance@lists.postgresql.org, hzzhangjiazhi Subject: Re: effective_io_concurrency on EBS/gp2 Message-ID: <20180207054227.GE17521@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jan 31, 2018 at 04:34:18PM -0300, Claudio Freire wrote: > In my experience playing with prefetch, e_i_c>0 interferes with kernel > read-ahead. What you've got there would make sense if what postgres > thinks will be random I/O ends up being sequential. With e_i_c=0, the > kernel will optimize the hell out of it, because it's a predictable > pattern. But with e_i_c=1, the kernel's optimization gets disabled but > postgres isn't reading much ahead, so you get the worst possible case. On Thu, Feb 01, 2018 at 03:39:07PM -0300, Claudio Freire wrote: > Problem is, if you're scanning a highly correlated index, the > mechanism is counterproductive. I had worked on some POC patches for > correcting that, I guess I could work something out, but it's > low-priority for me. Especially since it's actually a kernel "bug" (or > shortcoming), that could be fixed in the kernel rather than worked > around by postgres. On Sun, Feb 04, 2018 at 11:27:25PM -0300, Claudio Freire wrote: > ... Dense scans have large portions of contiguous fetches, a pattern that is > quite adversely affected by the current prefetch mechanism in linux. > > ... There's a rather simple workaround for this, pg should just avoid issuing > prefetch orders for sequential block patterns, since those are already much > better handled by the kernel itself. Thinking out loud.. if prefetch were a separate process, I imagine this wouldn't be an issue ; is it possible the parallel worker code could take on responsibility of prefetching (?) Justin