BTM
  1. BTM
  2. BTM-107

Add an alternate transaction journal with higher throughput (nio / java.util.concurrent based).

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Labels:
      None
    • Environment:
      Core i7 2600, Samsung SSD
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      3

      Description

      I found BTM a few weeks ago when I was looking for a replacement for c3p0 (which caused deadlocks) and really like it for it's simplicity and stability. When I saw BTM, I thought that JTA is even better for my Spring/Infinispan/Jpa based app anyway.

      All is stable now and fine until I switched from 'NullJournal' to 'DiskJournal'. The TX/s dropped to 1/10 of the values they've been before and I started thinking whether a disk journal should really drop performance so much... luckily BTM allows to create-your-own so I started to create a proof of concept.

      Attached is the compiled binary and a patch to the version currently in 'GIT' (actually only the parent pom is changed as the rest is simply a separate module). Built on my machine I got the following figures when running the unit tests:

      • DiskJournal: 12850 transactions, took 51,12 seconds (251,39 tx/s)
      • NioJournal (w. fsync): 257000 transactions, took 5,51 seconds (46667,88 tx/s)
      • NioJournal (w/o. fsync): 257000 transactions, took 1,43 seconds (179344,03 tx/s)
      • NullJournal (reference): 257000 transactions, took 0,20 seconds (1266009,85 tx/s)

      (Implementation class of the attached JAR is 'bitronix.tm.journal.nio.NioJournal')

      What I sent is a first working prototype and should really be considered experimental (license is Apache2 but can be changed to LGPL). Better test coverage and additional log output is pending. However I would appreciate the inclusion of the code and would be happy to continue working on this module if this is OK with you the lead .

      If you accept this it would probably be great to extract an abstract base class out of 'TransactionLogRecord' that contains only those entries that a Recoverer needs, so that I don't need to store values that have no use for the NIO journal.

      1. nio-journal.patch
        107 kB
        Juergen Kellerer

        Activity

        Hide
        Brett Wooldridge added a comment -

        Wow nice. Thanks for the contribution. I will also take a look at this in the next week or so.

        Show
        Brett Wooldridge added a comment - Wow nice. Thanks for the contribution. I will also take a look at this in the next week or so.
        Hide
        Franklin added a comment -

        Excellent Good job!!

        Show
        Franklin added a comment - Excellent Good job!!
        Hide
        Juergen Kellerer added a comment -

        Hi Folks, the journal is currently a "work in progress" that is done in "https://github.com/jkellerer/btm-fork/commits/btm-2.2.0". It will make it to BTM 2.2.0 once it's stable and integrated enough.

        Show
        Juergen Kellerer added a comment - Hi Folks, the journal is currently a "work in progress" that is done in "https://github.com/jkellerer/btm-fork/commits/btm-2.2.0". It will make it to BTM 2.2.0 once it's stable and integrated enough.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Juergen Kellerer
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: