Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 6A7BDB5DBF2 for ; Wed, 24 Aug 2011 09:17:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 09595-03 for ; Wed, 24 Aug 2011 12:16:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id C63B4B5DBFA for ; Wed, 24 Aug 2011 09:16:57 -0300 (ADT) Received: from [192.168.10.3] (AMontsouris-552-1-82-6.w92-140.abo.wanadoo.fr [92.140.41.6]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id A4AEB3B8F5; Wed, 24 Aug 2011 14:16:57 +0200 (CEST) Subject: Re: How to track number of connections and hosts to Postgres cluster From: Guillaume Lelarge To: Venkat Balaji Cc: Adarsh Sharma , pgsql-performance@postgresql.org Date: Wed, 24 Aug 2011 14:16:57 +0200 In-Reply-To: References: <1314172144.2193.9.camel@localhost.localdomain> <4E54DBDE.9030000@orkash.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1314188217.2193.18.camel@localhost.localdomain> Mime-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/265 X-Sequence-Number: 44712 On Wed, 2011-08-24 at 16:51 +0530, Venkat Balaji wrote: > But, the information vanishes if the application logs off. > That's why you need a tool to track this. > I am looking for an alternative to track the total amount of the connections > with the host IPs through a Cron job. > If you only want the number of connections, you can check_postgres. > What could be the frequency of cron ? > I don't think you can go below one second. > I know the best is using log_connections and log_disconnections parameters, > but, information logged would be too high and is also IO intensive. > Sure. But if you want connection duration, that's the only way. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com