[axonframework] Performance issues with Saga processing.

Hi Vijaya,

it is quite common for the SagaManager to be the performance bottleneck. This has to do with the continuous persistence of saga state.
An extra bottleneck arises with the use of @StartSaga. By default, this indicates that a new Saga instance needs to be started when this message comes in and no existing Sagas are associated with that message. To know the latter, the AsyncSagaManager will need to wait for all threads to have checked for existing Saga instances associated with that message.
Therefore, don’t make excessive use of @StartSaga. Model your Saga such that you know when to create a Saga and when you can expect on to already be created. Also, consider using @StartSaga(forceNew = true). This will always create a new instance, even if there already is an instance associated with that message. This will remove the need to “waitForSagaCreationVote”.

Note that 30 + 15 threads is quite high. Depending on the number of cores your server has, this may result in quite a large amount of thread context switching. Probably not the biggest bottleneck right now, but it does have an influence.

Cheers,

Allard

Thanks Allard!
We will do the changes in code and configurations and test the functionality.