Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSGO9-0007Mg-5z for pgsql-performance@arkaria.postgresql.org; Tue, 25 Mar 2014 01:42:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WSGO8-0005i6-Iy for pgsql-performance@arkaria.postgresql.org; Tue, 25 Mar 2014 01:42:48 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSGO6-0005gB-MT for pgsql-performance@postgresql.org; Tue, 25 Mar 2014 01:42:46 +0000 Received: from mbx.knossos.net.nz ([202.160.48.10]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WSGO1-00021x-Q0 for pgsql-performance@postgresql.org; Tue, 25 Mar 2014 01:42:46 +0000 Received: from [10.1.1.3] (121-99-178-175.bng1.nct.orcon.net.nz [121.99.178.175]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id s2P1gWJL028340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 25 Mar 2014 14:42:32 +1300 Message-ID: <5330DF08.6020005@archidevsys.co.nz> Date: Tue, 25 Mar 2014 14:42:32 +1300 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Brett Wooldridge CC: pgsql-performance@postgresql.org Subject: Re: Connection pooling - Number of connections References: <53309465.2000204@archidevsys.co.nz> In-Reply-To: Content-Type: multipart/alternative; boundary="------------020204080606090504020804" X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org This is a multi-part message in MIME format. --------------020204080606090504020804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 25/03/14 13:23, Brett Wooldridge wrote: > On Tue, Mar 25, 2014 at 5:24 AM, Gavin Flower > > > wrote: > >> Surely no code changes are required, as one can simply set the >> min and max pool sizes to be the same? > Cheers, > Gavin > > > To be sure it can be implemented that way, but its a question of > design targets. For example, if a pool is allowed to grow and shrink, > the design might encompass a pool of threads that try to maintain the > configured-minimum idle connections to respond to spike demands. And > there is the additional setting in the pool for users to [typically] > misconfigure. > > However, if the pool is fixed size, and attrition from the pool is > only by idle timeout (typically measured in minutes), the design does > not need to account for spike demand. Likely connections that have > dropped out can either be restored on-demand rather than something > running constantly in the background trying to maintain and idle level. > > One of the attributes of HikariCP is a minimalistic set of > configuration options with sane defaults, and minimalistic code. > There are many competitor pools, offering dozens of settings ranging > form banal to unsafe. HikariCP initially even offered some of these > options, but one-ny-one they're getting the ax. More and more we're > trying to look at what is the true core functionality that user's need > -- eliminate what is unnecessary and easily misconfigured. > > Thus a debate started over in our group, with some similar views as > expressed here (on both sides). Guillaume Smet was concerned about > the impact of idle connections on active ones in PostgreSQL (in a > fixed pool scenario) and wanted to ask some of the experts over here. > Would it be a valid option to switch in simpler code when min = max and both could be set to the same default? This would allow more efficient code to be run for a fixed pool size and allow a sane default, while preserving the option to have a range, though obviously not as simple as only allowing a fixed pool size in terms of code complexity. --------------020204080606090504020804 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 25/03/14 13:23, Brett Wooldridge wrote:
On Tue, Mar 25, 2014 at 5:24 AM, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:
Surely no code changes are required, as one can simply set the min and max pool sizes to be the same?
Cheers,
Gavin

To be sure it can be implemented that way, but its a question of design targets.  For example, if a pool is allowed to grow and shrink, the design might encompass a pool of threads that try to maintain the configured-minimum idle connections to respond to spike demands.  And there is the additional setting in the pool for users to [typically] misconfigure.

However, if the pool is fixed size, and attrition from the pool is only by idle timeout (typically measured in minutes), the design does not need to account for spike demand.  Likely connections that have dropped out can either be restored on-demand rather than something running constantly in the background trying to maintain and idle level.

One of the attributes of HikariCP is a minimalistic set of configuration options with sane defaults, and minimalistic code.  There are many competitor pools, offering dozens of settings ranging form banal to unsafe.  HikariCP initially even offered some of these options, but one-ny-one they're getting the ax.  More and more we're trying to look at what is the true core functionality that user's need -- eliminate what is unnecessary and easily misconfigured.

Thus a debate started over in our group, with some similar views as expressed here (on both sides).  Guillaume Smet was concerned about the impact of idle connections on active ones in PostgreSQL (in a fixed pool scenario) and wanted to ask some of the experts over here.

Would it be a valid option to switch in simpler code when min = max and both could be set to the same default?  This would allow more efficient code to be run for a fixed pool size and allow a sane default, while preserving the option to have a range, though obviously not as simple as only allowing a fixed pool size in terms of code complexity.

--------------020204080606090504020804--