Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPrPQ-0002Qg-Gu for pgsql-performance@arkaria.postgresql.org; Sun, 21 Aug 2022 20:19:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oPrPP-0006tx-AQ for pgsql-performance@arkaria.postgresql.org; Sun, 21 Aug 2022 20:18:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPrPP-0006tj-0t for pgsql-performance@lists.postgresql.org; Sun, 21 Aug 2022 20:18:59 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oPrPM-00030H-Df for pgsql-performance@lists.postgresql.org; Sun, 21 Aug 2022 20:18:57 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 9F0AD40003; Sun, 21 Aug 2022 20:18:49 +0000 (UTC) Message-ID: <35d221aa-3da4-f744-3965-ceca7f71f4ea@dunslane.net> Date: Sun, 21 Aug 2022 16:18:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: pgbench: could not connect to server: Resource temporarily unavailable Content-Language: en-US To: Tom Lane , Kevin McKibbin Cc: pgsql-performance@lists.postgresql.org References: <3909995.1661052002@sss.pgh.pa.us> From: Andrew Dunstan In-Reply-To: <3909995.1661052002@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-08-20 Sa 23:20, Tom Lane wrote: > Kevin McKibbin writes: >> What's limiting my DB from allowing more connections? >> This is a sample of the output I'm getting, which repeats the error 52 >> times (one for each failed connection) >> -bash-4.2$ pgbench -c 200 -j 200 -t 100 benchy >> ... >> connection to database "benchy" failed: >> could not connect to server: Resource temporarily unavailable >> Is the server running locally and accepting >> connections on Unix domain socket >> "/var/run/postgresql/.s.PGSQL.5432"? > This is apparently a client-side failure not a server-side failure > (you could confirm that by seeing whether any corresponding > failure shows up in the postmaster log). That means that the > kernel wouldn't honor pgbench's attempt to open a connection, > which implies you haven't provisioned enough networking resources > to support the number of connections you want. Since you haven't > mentioned what platform this is on, it's impossible to say more > than that --- but it doesn't look like Postgres configuration > settings are at issue at all. The first question in my mind from the above is where this postgres instance is actually listening. Is it really /var/run/postgresql? Its postmaster.pid will tell you. I have often seen client programs pick up a system libpq which is compiled with a different default socket directory. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com