Performance issue when multiple commands dispatched

Hi

we have a requirement to process multiple commands for a single transaction request, given below are the steps to process a transaction.

  1. Register a transaction

  2. A Saga starts upon listening to registration completed event.

  3. Publish 100k TestCommands from Saga service(S) to a client service(A) developed using Axon framework 4.5 and spring boot, each command will create an Event sourced aggregate an result in TestCommandExecutedEvent.

  4. A pagecompletedevent will be published upon listening to every 5k TestCommandExecutedEvent events in a event handler service(B).

  5. 100k commands are executed in batches. 5k commands will be triggerred upon listening to a pagecompletedevent in saga.

We are using a single context with one axonserver node ( Axon server 4.5 ).

We have configured below properties in the respective services

Saga Service (S) and Client service (A):

axon:
axonserver:
initial-nr-of-permits: 10000
nr-of-new-permits: 5000
new-permits-threshold: 5000
command-flow-control:
initial-nr-of-permits: 10000
nr-of-new-permits: 5000
new-permits-threshold: 5000

Event handler service(B):

axon:
axonserver:
initial-nr-of-permits: 10000
nr-of-new-permits: 5000
new-permits-threshold: 5000
eventhandling:
Test:
mode: tracking
batchSize: 100
threadCount: 4

When we post a single transaction request, end to end flow completes faster. But when we post two parallel transactions, we observed that the end to end time getting doubled for both transactions.

Please let us know if the same configuration to be done at axon server as well and also if any other configuration that will help with our requirement.

I am assuming that you have not changed the so-called “local segment”. This section of the Reference Guide actually explains it.

At any note, I would recommend changing the local segment to a different CommandBus implementation instead of the default SimpleCommandBus. That might already have some benefit.

Additionally, we have noted quite recently that an adjustment we made in Axon Server 4.5 might have had adverse impact on the performance in some scenarios. If performance is paramount in your application right away, it wouldn’t hurt to test how Axon Server 4.4 reacts.

Hi @Steven_van_Beelen

Thanks for the reply.

we used DisruptorCommandBus as local segment in the client service, but couldn’t see any difference in the performance.

we will try to use 4.4 and give a try.

Hi

The way we implemented Disruptor was incorrect :slight_smile: . we corrected our approach and performance looks good.

Thanks

1 Like