Atomikos Forum

JProfiler hotspot: 60% time spent in creating XA Conn wrapper

Hi,
Version of Atomikos being used is 3.6.3. We are using Atomikos Transaction manager and connection pool for XA transactions to Active MQ and Oracle.

We are seeing JProfiler hotspots related to creation of XA connection wrappers (mostly jdbc). Its taking an average of 85ms per invocation with some instances being as high as 440ms:
3.8% - 440 ms - 1 inv. com.atomikos.util.ClassLoadingHelper.newProxyInstance
----------------------------------------------
Hotspot:
59.9% - 6,982 ms - 83 hot spot inv. java.lang.reflect.Proxy.newProxyInstance
 59.9% - 6,982 ms - 83 hot spot inv. com.atomikos.util.ClassLoadingHelper.newProxyInstance
  43.7% - 5,095 ms - 41 hot spot inv.
  43.7% - 5,095 ms - 41 hot spot inv. com.atomikos.jdbc.AtomikosXAPooledConnection.doCreateConnectionProxy
    43.7% - 5,095 ms - 41 hot spot inv. com.atomikos.datasource.pool.AbstractXPooledConnection.createConnectionProxy
    42.8% - 4,990 ms - 40 hot spot inv. com.atomikos.datasource.pool.ConnectionPool.recycleConnectionIfPossible
     
com.atomikos.jdbc.AtomikosConnectionProxy.newInstance
  9.8% - 1,146 ms - 21 hot spot inv. com.atomikos.jms.AtomikosJmsConnectionProxy.newInstance
  6.3% - 739 ms - 21 hot spot inv. com.atomikos.jms.AtomikosJmsXaSessionProxy.newInstance
------------------------------------------------------

Our MQ/DB min and max connection pool sizes are set to 10 each.

Is there any way to minimize the time taken or the number of invocations? We are not setting any other pool attributes like max idle time, reap time, etc.,

Thanks,
Amar
Amar Phadke Send private email
Friday, August 13, 2010
 
 
Datasource class name used is: oracle.jdbc.xa.client.OracleXADataSource

<bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean"
        init-method="init" destroy-method="close" >
        <property name="maxPoolSize" value="${db.oracle.max.poolsize}" />
        <property name="minPoolSize" value="${db.oracle.min.poolsize}" />
        <property name="testQuery" value="SELECT 1 FROM DUAL" />
        <property name="uniqueResourceName" value="${db.oracle.user}" />
        <property name="xaDataSourceClassName" value="oracle.jdbc.xa.client.OracleXADataSource" />
        <property name="xaProperties" ref="xaProperties" />
    </bean>

Thanks,
Amar
Amar Phadke Send private email
Friday, August 13, 2010
 
 
Hi,

I think this problem was fixed in 3.6.5 - can you try that one first?

Thanks
Guy Pardon Send private email
Saturday, August 14, 2010
 
 
Upgrade seems to solve this problem.
Thanks a lot.

Regards,
Amar
Amar Phadke Send private email
Monday, August 16, 2010
 
 
I also see this issue.  JProfiler shows that it generally takes a little over 100 ms to generate the proxy for each connection.  This time can be much worse under load as the getConnection method is synchronized so if multiple requests come in at about the same time then some threads are blocked waiting in line for each thread to create a new proxy one at a time.  I have tried build 3.6.5 and the new 3.6.6 build in the Maven repo and get the same thing each time.  I am running in Virgo 2.1.0.M04. 


  47.2% - 115 ms - inh. 0 µs com.atomikos.jdbc.AbstractDataSourceBean.getConnection
  47.2% - 115 ms - inh. 0 µs com.atomikos.jdbc.AbstractDataSourceBean.getConnection
  47.2% - 115 ms - inh. 0 µs com.atomikos.datasource.pool.ConnectionPool.borrowConnection
  47.2% - 115 ms - inh. 0 µs com.atomikos.datasource.pool.AbstractXPooledConnection.createConnectionProxy
  47.2% - 115 ms - inh. 0 µs com.atomikos.jdbc.AtomikosXAPooledConnection.doCreateConnectionProxy
  47.2% - 115 ms - inh. 0 µs com.atomikos.jdbc.AtomikosConnectionProxy.newInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.newProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.internalNewProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.newProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.internalNewProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.newProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.internalNewProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.newProxyInstance
  47.2% - 115 ms - inh. 0 µs com.atomikos.util.ClassLoadingHelper.internalNewProxyInstance
  47.2% - 115 ms - inh. 0 µs java.lang.reflect.Proxy.newProxyInstance
Scott Price Send private email
Tuesday, October 05, 2010
 
 
If the default poolSize is set (i.e., 1) then this is normal because you will always create new physical connections to the backend... Did you try with maxPoolSize set to a higher value?

HTH
Guy Pardon Send private email
Saturday, October 09, 2010
 
 
BTW: my last question was for Scott... The other report does mention the poolSizes.
Guy Pardon Send private email
Saturday, October 09, 2010
 
 
On the same performance account: we had problems with the proxies in the past, but this was fixed precisely in 3.6.5 and later releases.

So my question: is it possible to send a reusable test config so we can do some regression tests for performance on realistic problem cases? Preferably with Derby instead of Oracle so it fits our light-weight architecture for testing.

I know I am asking a lot, but unless we can reproduce this there is no way to avoid it.

Thanks
Guy Pardon Send private email
Saturday, October 09, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics