Re: PostgreSQL db - Mailing list pgsql-admin

From Евгений Селявка
Subject Re: PostgreSQL db
Date
Msg-id CAKPhvNaWR7cji54A4Z9FzrLcTWzMV7NUVuaW5sVfYPNDUt3PZQ@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL db  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: PostgreSQL db  (Kevin Grittner <kgrittn@ymail.com>)
List 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@ymail.com>:
> Frank Zhou <zhouxuesong@gmail.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin



--
Best Regards,
Seliavka Evgenii


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Using psql, pg_dump, pg_restore in a script
Next
From: Oliver
Date:
Subject: Best backup strategy for production systems