Re: PostgreSQL db

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>:
> Frank Zhou <zhouxuesong@xxxxxxxxx> 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@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin



-- 
Best Regards,
Seliavka Evgenii



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux