Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxff1-0004z6-Bp for pgsql-admin@arkaria.postgresql.org; Fri, 12 Jul 2013 15:53:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Uxff0-0005Or-Hl for pgsql-admin@arkaria.postgresql.org; Fri, 12 Jul 2013 15:53:30 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxfez-0005Ol-Ng for pgsql-admin@postgresql.org; Fri, 12 Jul 2013 15:53:29 +0000 Received: from asbnvacz-mailrelay01.megapath.net ([207.145.128.243]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxfer-0002Yr-Uc for pgsql-admin@postgresql.org; Fri, 12 Jul 2013 15:53:28 +0000 Received: from mail4.sea5.speakeasy.net (mail4.sea5.speakeasy.net [69.17.117.48]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 7FF401EE565C for ; Fri, 12 Jul 2013 11:53:20 -0400 (EDT) Received: (qmail 21238 invoked from network); 12 Jul 2013 15:53:20 -0000 Received: by simscan 1.4.0 ppid: 21501, pid: 30205, t: 1.3848s scanners: clamav: 0.88.2/m:52/d:10739 spam: 3.0.4 Received: from 205-168-220-137.dia.static.qwest.net (HELO [192.168.4.17]) (sribe@elevated-dev.com@[205.168.220.137]) (envelope-sender ) by mail4.sea5.speakeasy.net (qmail-ldap-1.03) with AES128-SHA encrypted SMTP for ; 12 Jul 2013 15:53:18 -0000 Subject: Re: logging or debugging to report time to establish a database connection Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Scott Ribe In-Reply-To: Date: Fri, 12 Jul 2013 09:53:17 -0600 Cc: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Mike Broers X-Mailer: Apple Mail (2.1085) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail4.sea5 X-Spam-Level: X-Spam-Status: No, score=0.0 required=8.0 tests=none autolearn=disabled version=3.0.4 X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org BTW, just for the heck of it, I decided to try it out on my dev system (sev= eral year old 17" MacBook Pro, meaning core i7 processor), PostgreSQL 9.2, = pgbouncer 1.5. So, connecting via libpq to postgres directly takes 2-3 ms, = connecting to pgbouncer takes typically 70-150 us, with the occasional outl= ier at 500+ us--of course that's with a pgbouncer config with a big enough = pool that I never have to wait for a connection to become free. On Jul 12, 2013, at 9:21 AM, Scott Ribe wrote: > On Jul 12, 2013, at 9:00 AM, Mike Broers wrote: >=20 >> Is there something I am overlooking in postgres logging or psql client s= witches that would make this information available or am I stuck with lower= level tools? >=20 > Well, if you want to log how long pgbouncer takes to hand out a connectio= n from a pool, you're certainly not going to find that answer anywhere in p= ostgresql logging ;-) >=20 > Unfortunately, it doesn't look to me as though the pgbouncer console will= show you exactly that. Maybe using -v or -vv options would help? But yes, = average/max/min maybe even stddev of time to hand out a connection would se= em to be information that would be good to collect, so perhaps a feature re= quest is in order... >=20 > Of course there will also be overhead in the libraries that will vary fro= m one database manager to another, so in my opinion the only way to really = benchmark this would be from the client side anyway. Which is maybe what yo= u were thinking when asking about psql switches? Again, a feature request m= ight be in order--I can think of two possibilities: 1) a command-line verbo= se-mode switch that would provide details of the connection process, which = could be good also for debugging connection problems, showing what host is = being attempted, what the resolution (if any) of the host name is, connecti= on opened or not, authentication passed or not, and so on; 2) enhancements = to the /conninfo command to provide more details. >=20 >=20 > --=20 > Scott Ribe > scott_ribe@elevated-dev.com > http://www.elevated-dev.com/ > (303) 722-0567 voice >=20 >=20 >=20 >=20 >=20 >=20 > --=20 > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin >=20 --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin