X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 06222D1B592 for ; Fri, 31 Oct 2003 12:39:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87086-04 for ; Fri, 31 Oct 2003 08:39:04 -0400 (AST) Received: from mail.tpi.pl (mail.tpi.pl [193.110.121.18]) by svr1.postgresql.org (Postfix) with ESMTP id 05837D1B8DE for ; Fri, 31 Oct 2003 08:39:01 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.tpi.pl (Postfix) with ESMTP id B0A5A47002; Fri, 31 Oct 2003 13:39:03 +0100 (CET) Received: from mail.tpi.pl ([127.0.0.1]) by localhost (silver [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06424-10; Fri, 31 Oct 2003 13:39:03 +0100 (CET) Received: from [10.5.3.38] (lan-out [193.110.121.17]) by mail.tpi.pl (Postfix) with ESMTP id 2E78646FCF; Fri, 31 Oct 2003 13:39:03 +0100 (CET) Subject: Re: performance problem - 10.000 databases From: Marek Florianczyk To: Gaetano Mendola Cc: "pgsql-admin@postgresql.org" In-Reply-To: <3FA25062.9040900@bigfoot.com> References: <1067594647.22286.57.camel@franki-laptop.tpi.pl> <3FA25062.9040900@bigfoot.com> Content-Type: text/plain; charset=ISO-8859-2 Organization: Message-Id: <1067603494.22233.95.camel@franki-laptop.tpi.pl> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Oct 2003 13:31:34 +0100 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at TP Internet X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/390 X-Sequence-Number: 10951 W li¶cie z pi±, 31-10-2003, godz. 13:06, Gaetano Mendola pisze: > Marek Florianczyk wrote: > > > But my problem is that when I hit command: > > psql -h 127.0.0.1 dbname dbuser > > I'm waiting about 3-5 sec to enter psql monitor, so every new connection > > from apache will wait about 3-5 sec to put query to server. Thats a very > > long time... > > Why don't you use a connection manager ? What is connection manager? In PostgreSQL related project I only found SQLB ( Load Balancer ) but it's designed to use with one ( large ) database and maybe with more than one PostgreSQL server. The best solution for me, it would by small pogram installed on machine with apache + php, php would have persistent connection to this small program troghout unix socket, and client authorization would be done by this program. This program would have some pool of connection to PostgreSQL server. So apache could have let's say 3000 persistent connection to this small program, but this program would have 100 connection to PostgreSQL server and thats enought to process all queries. If traffic increase, clients, are already connected to local socket, and more new (tcp/ip) connection to server are made if necessery. The only trick is that pg_hba.conf of the PostgreSQL server would have: host any connectmanager ip_addr netmask md5 And the autorization of the 10.000 clients would be done by small program istalled on apache server. I've never heard about souch a software ;) What is a connection manager ? greetings Marek