Atomikos Forum

Performance Issue with multiple DBs.

Hi,

I am using atomikos version 3.6.4 in my project and connecting to two different schemas on a Database. My data sources are "AtomikosDataSourceBean" and using jdbcTemplate for querying database. Type of my transaction is "com.atomikos.icatch.jta.UserTransactionManager" as defined below:

<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">
        <property name="forceShutdown"><value>true</value></property>
    </bean>

    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
        <property name="transactionTimeout">
            <value>15</value>
        </property>
    </bean>

    <bean id="AppTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager">
            <ref bean="atomikosTransactionManager"/>
        </property>
        <property name="userTransaction">
            <ref bean="atomikosUserTransaction"/>
        </property>
    </bean>

I am sending select and update queries to one of these schemas and not using other one. But I have faced performance problem on :

- first db query (select query)
- transaction commit step.

It waits 5-6 seconds on the first query and transaction commit process. I taked thread dump and saw there are 4 Atomikos thread which are parked

"Atomikos:3" daemon prio=3 tid=0x00add800 nid=0x9b waiting on condition [0xbe5ff000]
  java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0xf7c268c8> (a java.util.concurrent.SynchronousQueue$TransferStack)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:662)

"Atomikos:2" daemon prio=3 tid=0x01e63000 nid=0x9a waiting on condition [0xbe6ff000]
  java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0xf7c268c8> (a java.util.concurrent.SynchronousQueue$TransferStack)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:662)

"Atomikos:1" daemon prio=3 tid=0x01e62400 nid=0x99 in Object.wait() [0xbe7ff000]
  java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0xebe67df8> (a java.lang.Object)
    at com.atomikos.timing.PooledAlarmTimer.doWait(PooledAlarmTimer.java:97)
    - locked <0xebe67df8> (a java.lang.Object)
    at com.atomikos.timing.PooledAlarmTimer.run(PooledAlarmTimer.java:63)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

"Atomikos:0" daemon prio=3 tid=0x00832c00 nid=0x98 waiting on condition [0xbf4ff000]
  java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0xf7c268c8> (a java.util.concurrent.SynchronousQueue$TransferStack)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
    at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
    at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:662)

Do you have any comments on this issue?
fetras Send private email
Friday, June 10, 2011
 
 
First thing to try: is the pool size as high as the number of concurrent threads?

The thread dump looks normal - pooled threads waiting for reuse IMHO?
Guy Pardon Send private email
Tuesday, June 14, 2011
 
 

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

Other recent topics Other recent topics