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 1h4sHU-0003rV-9r for pgsql-general@arkaria.postgresql.org; Fri, 15 Mar 2019 19:14:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4sHR-0000jH-OS for pgsql-general@arkaria.postgresql.org; Fri, 15 Mar 2019 19:14:09 +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 1h4sHR-0000Z8-9g for pgsql-general@lists.postgresql.org; Fri, 15 Mar 2019 19:14:09 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4sHN-0006ap-QC for pgsql-general@lists.postgresql.org; Fri, 15 Mar 2019 19:14:08 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EFCA421FE4; Fri, 15 Mar 2019 15:14:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 15 Mar 2019 15:14:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=J WdY0hCfEIEJlLcH7k4MNMVAIwkBdPd9lvfm2ayMto8=; b=saWgoFdkSxEl87nrG Do0dq7ayBlaWlXkkkGgedI8Lo/yN+hIzj+YVLzPl25CSM1qNOzGL/zwElD4x8cOe H6mwcwZTdfUBH6/rHX/9MFY6n6/LiDiRuUrCUZyPZwTBDx+ni69HEb8v7pEn+o+9 k2un1BUtV8mP3me6vyVD5vxqHArTwbLSP4tXVRgjea1hLEREKFj+e0ShqjfWUMY8 zs2ybf9k+PMzw3ZpSPDO1xCzDbtZwQapsQqqSZlJbFBGXj24vKl/XmRErHmgNdiM zus1kL2ZLhZ/kxj4UQyGqWHNcUbzxD5RXoeIpTSdnU5ncqDHbsqdPbf/0m4RX79T nj7fQ== DKIM-Signature: v=1; a=rsa-sha256; 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-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=JWdY0hCfEIEJlLcH7k4MNMVAIwkBdPd9lvfm2ayMt o8=; b=oJNyuc3PuAeRppO79aJnuHCtIRlfCzE0yPMLXHjaBIFU9bFE7VUfv+J/N 9nfHfuO+K7QVjvYD7SQr0vcXP1Hi+CGfz3s0EAEYrkxRoQXRPSzkKmxEXEz4pITV ttRwQKUde3u8KrNqGALf+5wQjiuqUE7wGjtTHBRW8ldR7Rqry/WKRG2BQ49W70ct VOc1FeghQHhTV7NLZuhMS2SXWE0X8YO/HfIhOdYlN3RJJCZ8SuGVfws2zcBHdPY6 rianwdt5D+xRj0tJ6bPAzSuZWv2LoygyXIIaY0IZZ9IfMghIXiuRAJjEbKjpOrnO CRVBQbf72g4KK6SjKoE3WiQy5eorg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrheehgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepvdhnughquhgrughrrghnthdrtghomhdpphhoshhtghhrvghs qhhlrdhorhhgnecukfhppeejuddrvdduvddrudehtddrvddtvdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 051C110312; Fri, 15 Mar 2019 15:14:03 -0400 (EDT) Subject: Re: Do all superuser processes count toward superuser_reserved_connections? To: Jeremy Finzel Cc: PostgreSQL General References: <1bb28189-8ba2-0666-f1e9-bec48691129c@aklaver.com> From: Adrian Klaver Message-ID: <78e8d547-e182-01f5-c038-470a1a0dd9a5@aklaver.com> Date: Fri, 15 Mar 2019 12:14:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; 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-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/15/19 8:16 AM, Jeremy Finzel wrote: > On Fri, Mar 15, 2019 at 9:48 AM Adrian Klaver > wrote: > > On 3/14/19 8:23 AM, Jeremy Finzel wrote: > > I don't find a clear mention in the docs of superuser processes > that are > > exempt from counting toward superuser_reserved_connections.  So I > would > > think that it's possible that postgres autovac workers ought to > count > > toward that.  Am I wrong about that?  I actually have the same > question > > AFAICK autovacuum workers do not use the connections referred to above. > The details can be found here: > > https://doxygen.postgresql.org/autovacuum_8c.html > > > Not sure I can really grok that and how it answers the question.  Are > you saying if you have max_connections set to 10, you could > theoretically have 20 autovac processes still? Yes: https://www.postgresql.org/docs/11/routine-vacuuming.html#AUTOVACUUM "There is no limit on how many workers might be in a single database, but workers do try to avoid repeating work that has already been done by other workers. Note that the number of running workers does not count towards max_connections or superuser_reserved_connections limits." > > > about pglogical replication background workers and manager, which > also > > run as postgres. > > But the actual connection can be by a different user: > > https://www.postgresql.org/docs/11/logical-replication-security.html > > > But I am speaking of pglogical, which does require superuser, last I > checked :). Aah, my mistake I conflated pglogical with the built in logical replication as the latter came from the former. Still: https://www.2ndquadrant.com/en/resources/pglogical/pglogical-docs/ 2.1 Quick Setup First the PostgreSQL server has to be properly configured to support logical decoding: wal_level = 'logical' max_worker_processes = 10 # one per database needed on provider node # one per node needed on subscriber node max_replication_slots = 10 # one per node needed on provider node max_wal_senders = 10 # one per node needed on provider node shared_preload_libraries = 'pglogical' > > It does use replication slots, but there are processes corresponding to > each subscription.  I have some databases with dozens of them. A process does not necessarily equal a connection. > > Thanks, > Jeremy -- Adrian Klaver adrian.klaver@aklaver.com