0 Replies Latest reply on Jul 28, 2011 10:31 AM by Romain Veysseyre

    Jboss very slow with remote postgresql

    Romain Veysseyre Newbie

      Hi,

      I used to connect JBoss to a local PostgreSQL server, and the performance are good in local use, but now I need to use a remote PostgreSQL server and the performance are very very poor. I try to change my -ds.xml from this :

       

       

      <datasources>

        <local-tx-datasource>

          <jndi-name>myBD</jndi-name>

          <connection-url>jdbc:postgresql://192.168.0.1:5432/mydb</connection-url>

          <driver-class>org.postgresql.Driver</driver-class>

          <user-name>user</user-name>

          <password>password</password>

          <min-pool-size>100</min-pool-size>

          <max-pool-size>400</max-pool-size>

          <blocking-timeout-millis>500000</blocking-timeout-millis>

          <idle-timeout-minutes>5</idle-timeout-minutes>

        </local-tx-datasource>

      </datasources>

       

      to this :

       

      <datasources>

         <xa-datasource>

           <jndi-name>oresteBD</jndi-name>

           <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>

           <xa-datasource-property name="ServerName">192.168.0.1</xa-datasource-property>

           <xa-datasource-property name="PortNumber">5432</xa-datasource-property>

           <xa-datasource-property name="DatabaseName">mydb</xa-datasource-property>

           <xa-datasource-property name="User">user</xa-datasource-property>

           <xa-datasource-property name="Password">password</xa-datasource-property>

           <min-pool-size>100</min-pool-size>

           <max-pool-size>400</max-pool-size>

           <idle-timeout-minutes>15</idle-timeout-minutes>

           <blocking-timeout-millis>5000</blocking-timeout-millis>

           <new-connection-sql>select 1</new-connection-sql>

           <check-valid-connection-sql>select 1</check-valid-connection-sql>

           <set-tx-query-timeout></set-tx-query-timeout>

           <track-connection-by-tx></track-connection-by-tx>

         </xa-datasource>

      </datasources>

       

       

      But it doesn't change anything, I checked on google and the only topic I found is this one :

      http://community.jboss.org/message/221030
      But they didn't solve the problem.

       

      I'm using JBoss 4.2.2.GA and PostgreSQL 8.4 on linux with a 2.6.32-23-generic x86_64 kernel jboss and postgresql are running on a Virtual Machine (VMWare private cloud). I try to put the 2 VM on the same hosts but it didn't fix my performance issue.

       

      If someone knows how to tune JBoss/PostgreSQL to fix this.

       

      Thank you.