Re: Built-in connection pooler

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Ryan Lambert <ryan(at)rustprooflabs(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Dimitri Fontaine <dim(at)tapoueh(dot)org>
Subject: Re: Built-in connection pooler
Date: 2019-07-27 10:40:00
Message-ID: CADK3HHLj5_69m-MEh2cC0oTz+Cn_rXm1FtP52q-1+tbrGLYbjA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Responses inline. I just picked up this thread so please bear with me.

On Fri, 26 Jul 2019 at 16:24, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
wrote:

> Hi Konstantin,
>
> I've started reviewing this patch and experimenting with it, so let me
> share some initial thoughts.
>
>
> 1) not handling session state (yet)
>
> I understand handling session state would mean additional complexity, so
> I'm OK with not having it in v1. That being said, I think this is the
> primary issue with connection pooling on PostgreSQL - configuring and
> running a separate pool is not free, of course, but when people complain
> to us it's when they can't actually use a connection pool because of
> this limitation.
>
> So what are your plans regarding this feature? I think you mentioned
> you already have the code in another product. Do you plan to submit it
> in the pg13 cycle, or what's the plan? I'm willing to put some effort
> into reviewing and testing that.
>

I too would like to see the plan of how to make this feature complete.

My concern here is that for the pgjdbc client at least *every* connection
does some set parameter so I see from what I can tell from scanning this
thread pooling would not be used at all.I suspect the .net driver does the
same thing.

> FWIW it'd be nice to expose it as some sort of interface, so that other
> connection pools can leverage it too. There are use cases that don't
> work with a built-in connection pool (say, PAUSE/RESUME in pgbouncer
> allows restarting the database) so projects like pgbouncer or odyssey
> are unlikely to disappear anytime soon.
>

Agreed, and as for other projects. I see their value in having the pool on
a separate host as being a strength. I certainly don't see them going
anywhere soon. Either way having a unified pooling API would be a useful
goal.

> I also wonder if we could make it more permissive even in v1, without
> implementing dump/restore of session state.
>
> Consider for example patterns like this:
>
> BEGIN;
> SET LOCAL enable_nestloop = off;
> ...
> COMMIT;
>
> or
>
> PREPARE x(int) AS SELECT ...;
> EXECUTE x(1);
> EXECUTE x(2);
> ...
> EXECUTE x(100000);
> DEALLOCATE x;
>

Again pgjdbc does use server prepared statements so I'm assuming this would
not work for clients using pgjdbc or .net

Additionally we have setSchema, which is really set search_path, again
incompatible.

Regards,

Dave

>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-07-27 11:49:10 Re: Built-in connection pooler
Previous Message Julien Rouhaud 2019-07-27 09:44:47 Re: Add parallelism and glibc dependent only options to reindexdb