Re: PostgreSQL db

From: Евгений Селявка <evg(dot)selyavka(at)gmail(dot)com>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Frank Zhou <zhouxuesong(at)gmail(dot)com>, Amit Sharma <asharma(at)verts(dot)co(dot)in>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: PostgreSQL db
Date: 2014-06-17 09:00:33
Message-ID: CAKPhvNaWR7cji54A4Z9FzrLcTWzMV7NUVuaW5sVfYPNDUt3PZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi, Kevin
I want to ask you about experience with java and dbcp pool, could you
describe this case in detail. I have one database and several app each
of this app have own datasource, which is a dbcp pool object. Maybe it
is good practice to use pgbouncer before dbcp data sources(but my
opinion it is not good practice to have 2 pool before database), or i
should calculate all dbcp datasources from all app with formula
sum(maxActive)=max connection - 3. And what about another java pool
realization, like HikariCP, do you try them?
This is my sample property file for dbcp:

<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url"
value="jdbc:postgresql://host.example.com:5432/db" />
<property name="username" value="user" />
<property name="password" value="password" />
<property name="minIdle" value="1" />
<property name="maxActive" value="20" />
<property name="maxWait" value="30000" />
<property name="validationQuery" value="SELECT 1" />
<property name="removeAbandoned" value="true" />
<property name="removeAbandonedTimeout" value="60" />
<property name="logAbandoned" value="true" />
</bean>

2014-06-13 6:28 GMT+04:00 Kevin Grittner <kgrittn(at)ymail(dot)com>:
> Frank Zhou <zhouxuesong(at)gmail(dot)com> wrote:
>
>> We are using client side pg_bouncer, do you think it is also an
>> acceptable option?
>
> It can be. If you can configure it for transaction mode and use a
> very small number of pools it can be very effective. Other modes
> don't help as much, although they can be easier to set up.
>
> If you are using Java I found Apache dbcp to be excellent.
>
> --
> Kevin Grittner
> EDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

--
Best Regards,
Seliavka Evgenii

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Oliver 2014-06-17 09:51:41 Best backup strategy for production systems
Previous Message Tom Lane 2014-06-16 23:33:30 Re: Using psql, pg_dump, pg_restore in a script