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 1nFYaD-0000BJ-OK for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 09:39:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nFYaC-0007Jg-Ky for pgsql-admin@arkaria.postgresql.org; Thu, 03 Feb 2022 09:39:16 +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 1nFYaC-0007JV-A8 for pgsql-admin@lists.postgresql.org; Thu, 03 Feb 2022 09:39:16 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFYa9-0003tG-5x for pgsql-admin@lists.postgresql.org; Thu, 03 Feb 2022 09:39:15 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 15EA75C0113; Thu, 3 Feb 2022 04:39:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 03 Feb 2022 04:39:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=d5uykMp0Zq1DHTwprEYaPCalT+j+KvALSTr36QSxmcM=; b=SCYEDTuG uE8bXn6SCcJs3pTcn8P/AUF7yf9cUO1Bc1EnhFRNkFqg0avEKV7PLyxN1Nkgsnxa UU9kJaoWrcei0xS8GDxh1RB7ciWYweL7AkAZSG8IOpykuzt+nEmcLabREul7whP8 hiuAuAZ4DglJsMAfCaj3Hz/PVayD1KjoOo4cw84aMpfEu/3x7Ag+C65SIr3wdIN6 2+qf9owT+pNBZRy8K4Ok1CMYW2A2SjgvGCnUow6iFY0AsgYZMZmR9cjltIxPkkTF EUwZa+lwl3Xbh5n217RnZbuLLEBxI76zVvCidPqT6x0V6eGhX1aKfmOqK1KY7IEO weFQ/s/e7d8Yqw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeejgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthejre dttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdr vghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomheqnecuggftrfgrth htvghrnhepfeejgeehteeuhfevveduleeufedtjeetiefftedvudfhtdeifefgueettdev gefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepph gvthgvrhdrvghishgvnhhtrhgruhhtsegvnhhtvghrphhrihhsvggusgdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Feb 2022 04:39:10 -0500 (EST) Message-ID: Date: Thu, 3 Feb 2022 10:39:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: pgbouncer logs and its efficiency Content-Language: en-US To: Victor Sudakov , pgsql-admin@lists.postgresql.org References: <2d4321bd-0174-42c9-3671-fa9626326d10@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.