5

We have spring-boot application with atomikos transaction manager. Problem is that commit in XA transaction takes a lot of time when I compared it with weblogic solution.

This are the metrics from our application

process_seconds_count 28072.0
process_seconds_sum 3288.249

process_commit_seconds_count 28072.0
process_commit_seconds_sum 2471.917

so 4/5 of the process time take just commit. How we should optimize it ?

application.properties:

spring.jta.enabled=true
spring.jta.atomikos.properties.log-base-dir=target/transaction-logs/
spring.jta.atomikos.properties.service=com.atomikos.icatch.standalone.UserTransactionServiceFactory
spring.jta.atomikos.properties.max-timeout=900000
spring.jta.atomikos.properties.default-jta-timeout=90000
spring.jta.atomikos.properties.threaded-two-phase-commit=true
spring.jta.atomikos.datasource.default-isolation-level=2
spring.transaction.default-timeout=900

UPDATE:

from logs I see there is huge gap between commiting and terminated state:

7845373:2018-06-12 11:09:35.468 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 entering state: PREPARING
7845727:2018-06-12 11:09:35.474 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 entering state: IN_DOUBT
7845736:2018-06-12 11:09:35.474 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - prepare() of Coordinator  10.0.1.173.tm152879457543219025 returning YES vote
7845737:2018-06-12 11:09:35.474 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 entering state: COMMITTING
7848193:2018-06-12 11:09:35.591 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 entering state: TERMINATED
7848282:2018-06-12 11:09:35.591 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 : stopping timer...
7848289:2018-06-12 11:09:35.592 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 : disposing statehandler TERMINATED...
7848290:2018-06-12 11:09:35.592 [http-nio-7002-exec-8] TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.173.tm152879457543219025 : disposed.

UPDATE2:

another big gap between two rows:

15:43:11.122: http-nio-7002-exec-8 TRACE c.atomikos.icatch.imp.CoordinatorImp - Coordinator 10.0.1.188.tm152881099106619948 entering state: COMMITTING
15:43:11.253: http-nio-7002-exec-8 DEBUG c.a.d.xa.XAResourceTransaction - XAResource.commit ( 31302E302E312E3138382E746D313532383831303939313036363139393438:31302E302E312E3138382E746D3737373438 , false ) on resource LOGRW2_29a041bd2a68 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@b477508
hudi
  • 15,555
  • 47
  • 142
  • 246
  • 2
    Are you using more than one data source (i.e. do you really need XA here)? If not Weblogic probably uses the last resource gambit and gets away with much cheaper local transactions. Just a guess. Also, have you tried without threaded 2pc commits? The default setting is false for recent versions. Plus the transaction logs should use a fast and reliable disk, I doubt that target/transaction-logs fits the bill! – ewramner Jun 15 '18 at 13:04

0 Answers0