Re: Built-in connection pooling

From: Ivan Novick <inovick(at)pivotal(dot)io>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Built-in connection pooling
Date: 2018-01-28 22:01:07
Message-ID: CAPJXddZDD=C6aYb8P5yd9kWcSH+ijK5VV8v4uGT3cJWjy++mqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jan 27, 2018 at 4:40 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Mon, Jan 22, 2018 at 06:51:08PM +0100, Tomas Vondra wrote:
> Right now, if you hit max_connections, we start rejecting new
> connections. Would it make sense to allow an option to exit idle
> connections when this happens so new users can connect?
>
>
A lot of users have bash scripts to check the system periodically and canel
idle connections to prevent other users from getting rejected by max
connections. They do this on a timer, like if the session appears to be
idle more than 10 minutes.

> I know we have relied on external connection poolers to solve all the
> high connection problems but it seems there might be simple things we
> can do to improve matters. FYI, I did write a blog entry comparing
> external and internal connection poolers:
>

Yes, that would be great.

The simplest thing sounds like a GUC that will automitcally end a
connection idle for X seconds.

Another option could be as you suggested, Bruce, if a user would have
failed because of max connections already reached, then terminate the
connection that has been idle the longest and allow a new connection to
come in.

These would greatly improve user experience as most folks have to automate
this all themselves anyway.

Cheers,
Ivan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pierre Ducroquet 2018-01-28 22:02:56 Re: JIT compiling with LLVM v9.0
Previous Message Thomas Munro 2018-01-28 21:57:11 Re: Transform for pl/perl