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 1uh5gl-00AQDN-6S for pgpool-general@arkaria.postgresql.org; Wed, 30 Jul 2025 12:13:44 +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 1uh5gk-009ScV-A3 for pgpool-general@arkaria.postgresql.org; Wed, 30 Jul 2025 12:13:42 +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 1uh5gj-009ScM-VB for pgpool-general@lists.postgresql.org; Wed, 30 Jul 2025 12:13:42 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uh5gh-001YYg-22 for pgpool-general@lists.postgresql.org; Wed, 30 Jul 2025 12:13:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=/Xf0SerGEDUGO54SL7WNkq5iVC3DN82AB6/ub4s0y1c=; b=XL98HWN5D53G2G6F+ztCLBG7MJ CtJW/Oz0276YIGnHCd5Jcx/moUYgTGI2ZpXiUcg8RLCYqTnreGq8zw7pLP6dItiPdF9yk7bOTYMJH HLD+rRdQ+85P61+xyHh4ATKvIo+qBEb1Dwfozkld0zgadexuvnl8mKRGAvof1k2C3/Ujn1xW8LkY0 UJrphcNqxHglVQl5rXOXFizIdN5BXm1GGpTZ/M3KZKl+VqwR/4e3iLWMg0RChH66CLPYfzVzYA16U Nw2cA3Me9FbgKmISM9ccRMbB8d3HmBJI9VaHO77QE68h+MORgoM6o7gNvmpt5rE9YVrleyt/z2qPv Of7G58BA==; Received: from [2409:11:4120:300:c05b:68ea:597c:a39e] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.96) (envelope-from ) id 1uh5gd-00418U-04; Wed, 30 Jul 2025 12:13:38 +0000 Date: Wed, 30 Jul 2025 21:13:24 +0900 (JST) Message-Id: <20250730.211324.1175750923831808216.ishii@postgresql.org> To: r_suzuki@sjts.co.jp Cc: pgpool-general@lists.postgresql.org Subject: Re: Sudden increase in connections in pgpool usage environment From: Tatsuo Ishii In-Reply-To: References: <6c74ac0b-f943-4b27-ba7f-c6b3380faf4a@sjts.co.jp> <20250728.195522.1634717277013819274.ishii@postgresql.org> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:c05b:68ea:597c:a39e (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >> Is it possible Server1 overloaded? I am asking because on server1 3 >> kinds of servers are running. I suspect pgpool process are not enough >> CPU being assigned, and cannot dispatch incoming new connections. > > Under normal conditions, the server load is not particularly > problematic. > Rather, it seems that the load increases at the same time the "DISCARD > ALL" occurs. > > Regarding the phrase "cannot dispatch incoming new connections," > I was wondering―does pgpool sometimes establish connections to > PostgreSQL automatically, > even if a connection is not explicitly needed? What do you mean by "even if a connection is not explicitly needed"? Can you elaborate more? > My current understanding is that a connection to PostgreSQL is created > only when Tomcat makes a request for one, > and that pgpool initiates the connection at that point. Yes. > Since it’s a bit hard to imagine the web system suddenly using up as > many as 300 connections all at once, > I just wanted to check and make sure I’m not misunderstanding how > this works. For pgpool To create 300 connections to PostgreSQL, you don't need to have 300 web connections exactly at the same timing. When a client connects pgpool, one of pgpool "child" process is chosen by kernel. If the process already have a suitable connections cache (i.e. matches the requested username/database etc.), no new connection to PostgreSQL is created. However the process does not have, a new connection to PostgreSQL is created. Since kernel does not care whether the particular pgpool process already has the requested connection to PostgreSQL, it is possible that a pgpool process which does not have the connection. So if you are unlucky, continuous a few number of concurrent requests from clients could make all 300 pgpool process connect to PostgreSQL. To deal with the situation, you can tweak configurations in "- Life time -" section of pgpool.conf. See the manual for more details. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp