Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1buLFe-0000xU-Of for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 15:15:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1buLFe-00061o-8O for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Oct 2016 15:15:26 +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 1buLEG-000499-CZ for pgsql-hackers@postgresql.org; Wed, 12 Oct 2016 15:14:00 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1buLEC-0004JA-Nl for pgsql-hackers@postgresql.org; Wed, 12 Oct 2016 15:13:59 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id CE55C20770; Wed, 12 Oct 2016 11:13:54 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 12 Oct 2016 11:13:54 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=5W7UhKV4wXVsWeX UwFo5SKoU1v8=; b=toD9p24b0NBahYnptuRA+zkEJmMF+cr0+E1V/viMqLCMB8F R/74WPVIQVIv81amXaM0rMHtOmINRRAgMZ2MdOY2IVSLCsQVdftQHwbyYePVlwRQ ZUQHVdbV9OLfMXMdJHyuYPFNuPk/6SeWzv3z89bMnbgtiARWI6SOwppCXEcs= X-Sasl-enc: /BNmVZgH4vCEwWo1zPxR33FmkNOZvg6kaTYdTQV9sh6R 1476285234 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 31AA3CC08C; Wed, 12 Oct 2016 11:13:54 -0400 (EDT) Subject: Re: Rename max_parallel_degree? To: Julien Rouhaud References: <20160426152217.GA548975@alvherre.pgsql> <20312f33-c14e-0d3f-a79f-95212f64a38c@dalibo.com> <9a3ca4ad-c3ea-2c02-499a-029e053fedda@dalibo.com> <7ef3a740-8c64-764d-9f02-b27132d89602@2ndquadrant.com> <699e9156-fb30-7a6d-0f5f-b78b97ddce14@dalibo.com> Cc: Robert Haas , Amit Kapila , Tom Lane , Josh Berkus , "David G. Johnston" , Peter Geoghegan , Noah Misch , David Rowley , Alvaro Herrera , Magnus Hagander , Bruce Momjian , PostgreSQL-development From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <243bd031-771f-d84c-72d7-96f62e97042d@2ndquadrant.com> Date: Wed, 12 Oct 2016 11:13:53 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) 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 10/4/16 10:16 AM, Julien Rouhaud wrote: > Please find attached v9 of the patch, adding the parallel worker class > and changing max_worker_processes default to 16 and max_parallel_workers > to 8. I also added Amit's explanation for the need of a write barrier > in ForgetBackgroundWorker(). This approach totally messes up the decoupling between the background worker facilities and consumers of those facilities. Having dozens of lines of code in bgworker.c that does the accounting and resource checking on behalf of parallel.c looks very suspicious. Once we add logical replication workers or whatever, we'll be tempted to add even more stuff in there and it will become a mess. I think we should think of a way where we can pass the required information during background worker setup, like a pointer to the resource-limiting GUC variable. For style, I would also prefer the "class" to be a separate struct field from the flags. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers