Re: Built-in connection pooling

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Built-in connection pooling
Date: 2018-01-19 16:28:11
Message-ID: CAFj8pRBbJJttkANAxsZ3OKKEBD-b208g_-GGrj6t-_uro-MkeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When I've been thinking about adding a built-in connection pool, my
>> rough plan was mostly "bgworker doing something like pgbouncer" (that
>> is, listening on a separate port and proxying everything to regular
>> backends). Obviously, that has pros and cons, and probably would not
>> work serve the threading use case well.
>>
>
> And we will get the same problem as with pgbouncer: one process will not
> be able to handle all connections...
> Certainly it is possible to start several such scheduling bgworkers... But
> in any case it is more efficient to multiplex session in backend themselves.
>

pgbouncer hold all time client connect. When we implement the listeners,
then all work can be done by worker processes not by listeners.

Regards

Pavel

> But it would have some features that I find valuable - for example, it's
>> trivial to decide which connection requests may or may not be served
>> from a pool (by connection to the main port or pool port).
>>
>> That is not to say the bgworker approach is better than what you're
>> proposing, but I wonder if that would be possible with your approach.
>>
>>
>> regards
>>
>>
> --
> Konstantin Knizhnik
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-01-19 16:28:16 Re: [HACKERS] Refactor handling of database attributes between pg_dump and pg_dumpall
Previous Message Tomas Vondra 2018-01-19 16:27:44 Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions