[ADMIN] logging or debugging to report time to establish a database connection

2013-07-12 Thread Mike Broers
I was recently asked how long it takes for postgres (or in my case pgbouncer) to create a database connection and could not find a way within postgres logging or psql to report this information. I came across depesz's great article on pgbouncer utilizing tcpdump: http://www.depesz.com/2012/12/02/w

Re: [ADMIN] logging or debugging to report time to establish a database connection

2013-07-12 Thread Scott Ribe
On Jul 12, 2013, at 9:00 AM, Mike Broers wrote: > Is there something I am overlooking in postgres logging or psql client > switches that would make this information available or am I stuck with lower > level tools? Well, if you want to log how long pgbouncer takes to hand out a connection from

Re: [ADMIN] logging or debugging to report time to establish a database connection

2013-07-12 Thread Scott Ribe
BTW, just for the heck of it, I decided to try it out on my dev system (several 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

Re: [ADMIN] logging or debugging to report time to establish a database connection

2013-07-12 Thread Scott Ribe
On Jul 12, 2013, at 9:59 AM, Mike Broers wrote: > Thanks, did you use tcpdump to determine that? I'm happy to learn a new tool > (to me), but wanted to make sure I wasnt overlooking something at my disposal > within postgres. When I said "connecting via libpq" I meant I inserted timers in some