X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 48ABC9FB0D1 for ; Wed, 10 May 2006 16:39:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 63400-04-6 for ; Wed, 10 May 2006 16:39:06 -0300 (ADT) X-Greylist: delayed 00:31:49.006716 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B6AD19FA38E for ; Wed, 10 May 2006 16:38:44 -0300 (ADT) Received: from colo-dns-ext2.juniper.net (colo-dns-ext2.juniper.net [207.17.137.64]) by svr4.postgresql.org (Postfix) with ESMTP id 2E1C35B6D4C for ; Wed, 10 May 2006 19:06:53 +0000 (GMT) Received: from merlot.juniper.net (merlot.juniper.net [172.17.27.10]) by colo-dns-ext2.juniper.net (8.12.3/8.12.3) with ESMTP id k4AJ6l1Z018324 for ; Wed, 10 May 2006 12:06:47 -0700 (PDT) (envelope-from kenjim@juniper.net) Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [172.17.58.60]) by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id k4AJ6l557230; Wed, 10 May 2006 12:06:47 -0700 (PDT) (envelope-from kenjim@juniper.net) Received: from kenjim-lnx.juniper.net (kenjim-lnx.juniper.net [127.0.0.1]) by kenjim-lnx.juniper.net (8.13.4/8.13.4) with ESMTP id k4AJ6laM013345; Wed, 10 May 2006 12:06:47 -0700 Received: (from kenjim@localhost) by kenjim-lnx.juniper.net (8.13.4/8.13.4/Submit) id k4AJ6kHd013344; Wed, 10 May 2006 12:06:46 -0700 Date: Wed, 10 May 2006 12:06:46 -0700 From: Kenji Morishige To: pgsql-admin@postgresql.org Cc: kenjim@juniper.net Subject: limiting number of connections from specific host or by user Message-ID: <20060510190646.GA12986@juniper.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/118 X-Sequence-Number: 21650 We are having a problem where we are running out of connections due to a in-house tool that creates abnormal amount of connections due to fluctuating loads that we cannot control. Ideally, the tool could be re-written to take into account for those situations, but due to its complexity we don't have the time to do so. I am trying to come up with a solution to block incoming connections when they reach a certain hard limit. Is there any way from PostgreSQL user authentication or other methods to cap connection count by user or by host? I had considered creating a firewall rule after detecting a certain amount of established connection from a particular host, but this seems very inflexible as well. Any ideas or suggestions appreciated. Sincerely, Kenji