Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc3ry-003ZN4-Gg for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 14:11:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sc3rw-00EdKh-Fj for pgsql-general@arkaria.postgresql.org; Thu, 08 Aug 2024 14:11:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc3rw-00EdKY-49 for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 14:11:56 +0000 Received: from smtp114.iad3b.emailsrvr.com ([146.20.161.114]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sc3rt-003ibm-MH for pgsql-general@lists.postgresql.org; Thu, 08 Aug 2024 14:11:54 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp23.relay.iad3b.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 57F34A015B; Thu, 8 Aug 2024 10:11:52 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: Vacuum full connection exhaustion From: Christophe Pettus In-Reply-To: Date: Thu, 8 Aug 2024 07:11:21 -0700 Cc: pgsql-general@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <66D17234-043D-457E-8607-5126B4FBC3DD@thebuild.com> References: To: Costa Alexoglou X-Mailer: Apple Mail (2.3774.600.62) X-Classification-ID: 5b9eff09-8a6c-4c32-9f76-094404520c01-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Aug 7, 2024, at 10:34, Costa Alexoglou wrote: >=20 > Hey folks, >=20 > I noticed something weird, and not sure if this is the expected = behaviour or not in PostgreSQL. >=20 > So I am running Benchbase (a benchmark framework) with 50 terminals = (50 concurrent connections). > There are 2-3 additional connections, one for a postgres-exporter = container for example. >=20 > So far so good, and with a `max_connections` at 100 there is no = problem. What happens is that if I execute manually `VACUUM FULL` the = connections are exhausted. VACUUM FULL takes an exclusive lock on the table that it is operating = on. It's possible that a connection becomes blocked on that exclusive = lock waiting for the VACUUM FULL to finish, the application sees the = connection stopped and fires up another one (this is common in = container-based applications), that one blocks... until all of the = connections are full of queries waiting on that VACUUM FULL.=