0 Replies Latest reply on Nov 2, 2006 3:20 PM by jsicotte2

    Slow DataSouce Failover

      I am experiencing a slow failover when simulating a network failure. My setup consists of the following: Two servers, each with an instance of JBoss and MySQL running on them. I will refer to the servers as a ?primary? and ?backup?. Both the primary and backup have their DataSources set to point to the MySQL instance running on the primary server. They are HA DataSources, so they also point to the backup server. I simulate a network failure by unplugging the primary from a network hub. Then the following happens:
      1) The backup server/node detects the failure.
      2) Several minutes go by after the cluster failure, and then our app is deployed.

      After playing with Log4j settings and some more testing, I have narrowed the issue down to a set of failures:

      2006-10-26 15:50:34,843 INFO [org.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:/DefaultDS
      
      2006-10-26 15:51:06,343 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
      
      2006-10-26 15:51:50,484 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
      
      006-10-26 15:52:28,437 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Destroying connection that is not valid
      
      2006-10-26 15:52:49,578 WARN [org.jboss.resource.adapter.jdbc.local.HALocalManagedConnectionFactory] Failed to create connection for jdbc:mysql://nscluster-3:4589/netsight: Communications link failure


      Since the DataSouce connection pool size is set to a minimum of three, it seems that a database connection is not considered dead until all thread pool connections are timed out. The timeouts take a little over two minutes to complete, and if the minimum thread pool size was larger, the failover time would be protracted even more. Is there any way to reduce the duration of the timeouts and/or speed up this process?