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 1nFdpv-0001cc-1D for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 15:15:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFdpt-0000Wn-U7 for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 15:15:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFdpt-0000US-Hm for pgsql-admin@lists.postgresql.org; Thu, 03 Feb 2022 15:15:49 +0000 Received: from admin.sibptus.ru ([2001:19f0:5001:21dc::10]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFdpp-0002tQ-Ug for pgsql-admin@lists.postgresql.org; Thu, 03 Feb 2022 15:15:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=In-Reply-To:Message-ID:Subject:To:From:Date; bh=a5CKICcaOZ7lnMMnyyj1Rh8B2ewNpLmbtOuBQJQCKbE=; b=CWEOH6JWZSXd+v42+X+PgzK7p6 8vh5vTvOJQgFQFOzVCN5AJdQy0oYIGI7LDoBvZIn89/WRa1xD43XxvJ5Ainf2THi1R9bDbrSNIE0T bkIJDL6w+JTRTwYGHW/V3vNupWUYJDqb1UTpLzu3gmNAO4Yj2rGW8nyMvl9g2DHTMB2w=; Received: from vas by admin.sibptus.ru with local (Exim 4.95 (FreeBSD)) (envelope-from ) id 1nFdpo-00082T-67; Thu, 03 Feb 2022 15:15:44 +0000 Date: Thu, 3 Feb 2022 15:15:44 +0000 From: Victor Sudakov To: pgsql-admin@lists.postgresql.org Cc: Peter Eisentraut Subject: Re: pgbouncer logs and its efficiency Message-ID: References: <2d4321bd-0174-42c9-3671-fa9626326d10@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-Key: http://admin.sibptus.ru/~vas/ X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut wrote: > On 02.02.22 09:45, Victor Sudakov wrote: > >>> 2. How would you calculate the efficiency of pgbouncer, like > >>> client_conns/server_conns ratio (current and average over over time)? > >> > >> This depends heavily on what you are using pgbouncer for and what > >> metrics are relevant for your application. > > > > The relevant metric would be the client_conns/server_conns ratio. If > > there have been 1000 client connections/disconnections and they have > > caused only 100 new backends to start, I'd consider it a good ratio. > > > > The question is how to estimate it. > > You can count the number of rows in the SHOW CLIENTS and SHOW SERVERS > output and chart them using your favorite metrics collection system. > There are various tools and recipes out there on how to collect metrics > from pgbouncer and push them into metrics or graphing systems. Hello Peter, If I were going to continuously monitor the pgbouncer efficiency, it would be a good idea. Maybe there is even a Prometheus exporter for pgbouncer. However, do you think this information can be inferred from pgbouncer logs in some way? Because I need it only occasionally. If, for example, I divide the number of "login attempt" lines in the log by the number of "new connection to server" lines, will this be the ratio I'm looking for? -- Victor Sudakov VAS4-RIPE http://vas.tomsk.ru/ 2:5005/49@fidonet