Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b8dVv-0007vs-H2 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jun 2016 01:03:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b8dVv-0003Fe-04 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Jun 2016 01:03:03 +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 1b8dVu-0003FX-Ff for pgsql-hackers@postgresql.org; Fri, 03 Jun 2016 01:03:02 +0000 Received: from zmcc-5-mx.zmailcloud.com ([192.198.93.228]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b8dVr-00057F-6E for pgsql-hackers@postgresql.org; Fri, 03 Jun 2016 01:03:02 +0000 Received: from zmcc-5-mta-1.zmailcloud.com (127.37.197.104.bc.googleusercontent.com [104.197.37.127]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zmcc-5-mx.zmailcloud.com (Postfix) with ESMTPS id A328B5202CC; Thu, 2 Jun 2016 21:02:56 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTP id 4AD8AC1DD8; Fri, 3 Jun 2016 01:02:56 +0000 (UTC) Received: from zmcc-5-mta-1.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-5-mta-1.zmailcloud.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nmIy4Njo3N1a; Fri, 3 Jun 2016 01:02:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTP id 5B39BC2DA1; Fri, 3 Jun 2016 01:02:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at zmcc-5-mta-1.zmailcloud.com Received: from zmcc-5-mta-1.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-5-mta-1.zmailcloud.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MQ0Ric5EONVh; Fri, 3 Jun 2016 01:02:55 +0000 (UTC) Received: from redhat.com (c-98-246-109-153.hsd1.or.comcast.net [98.246.109.153]) by zmcc-5-mta-1.zmailcloud.com (Postfix) with ESMTPSA id 49D62C1DD8; Fri, 3 Jun 2016 01:02:54 +0000 (UTC) Subject: Re: Rename max_parallel_degree? To: "David G. Johnston" References: <20160426152217.GA548975@alvherre.pgsql> <7570.1464816591@sss.pgh.pa.us> <575051AF.2090101@agliodbs.com> <21660.1464882811@sss.pgh.pa.us> <57508E69.9000505@agliodbs.com> <57509894.9080507@agliodbs.com> Cc: Tom Lane , Robert Haas , Amit Kapila , Peter Geoghegan , Noah Misch , David Rowley , Alvaro Herrera , Magnus Hagander , Bruce Momjian , PostgreSQL-development From: Josh berkus Message-ID: <5750D73D.8080203@agliodbs.com> Date: Thu, 2 Jun 2016 18:02:53 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 06/02/2016 01:42 PM, David G. Johnston wrote: > =E2=80=8BAre you referring to right now or if we move the goal posts = to making > > this a per-statement reservation?=E2=80=8B >=20 > I was assuming that we would have *both* per-operation and per-statem= ent > limits. I can see reasons for having both, I can see why power users > would want both, but it's going to be overwhelming to casual users. >=20 >=20 > =E2=80=8B Got that. The only problem on that front with the current setu= p is > that right now we are saying: "at most use 3 of the 8 available > processes": i.e., we tie ourselves to a fixed number when I think a > better algorithm would be: "on/off/auto - default auto" and we detect at > runtime whatever values we feel are most appropriate based upon the > machine we are running on. If the user doesn't like our choices they > can specify their own values. But the only specified values in the > configurations would be those placed there automatically by the user.=20 > If value isn't specified but is required it gets set at startup and can > be seen in pg_settings. >=20 Well, the hard part here is that the appropriate value is based on the level of concurrency in the database as a whole. For example, if it's a website database with 200 active connections on a 32-core machine already, you want zero parallelism. Whereas if it's the only current statement on a 16-core VM, you want like 8. That sounds like a heuristic, except that the number of concurrent statements can change in milleseconds. So we'd really want to base this on some sort of moving average, set conservatively. This will be some interesting code, and will probably need to be revised several times before we get it right. Particularly since this would involve scanning some of the global catalogs we've been trying to move activity off of. --=20 -- Josh Berkus Red Hat OSAS (any opinions are my own) --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers