Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected database load with JpaEventStorageEngine::fetchEvents ramping up #2641

Open
junkdog opened this issue Mar 13, 2023 · 3 comments
Open
Assignees
Labels
Status: Information Required Use to signal this issue is waiting for information to be provided in the issue's description. Type: Question Use to signal the issue is a question of how the project works and thus does not require development

Comments

@junkdog
Copy link

junkdog commented Mar 13, 2023

Basic information

  • Axon Framework version: 4.7.1
  • JDK version: Amazon Corretto 17

Description

Hi,

We have identified an issue with one of our applications that is built using Spring Boot 3, JPA, and Axon Framework 4.7.1. In a particular environment, we have noticed that despite low traffic, the database load is uneven.

image
(requests to RDS grouped by query)

Upon investigation, we have found that JpaEventStorageEngine::fetchEvents appeared to be ramping up over time, as indicated by the increasing blue bars. It is worth noting that during this time period, there was no scaling activity apart from a single deploy at 23 Feb 1500, which only caused a small bump. Interestingly, the UPDATE token_entry statement shown in the yellow bars was running at a constant rate.

Is this something you've seen in the past? Any ideas on how we could investigate this further?

Expected behavior

During no load, JpaEventStorageEngine::fetchEvents should be invoked at a more-or-less constant rate.

Actual behaviour

In one of our environments, it ramped up over time.

@junkdog junkdog added the Type: Bug Use to signal issues that describe a bug within the system. label Mar 13, 2023
@gklijs
Copy link
Member

gklijs commented Mar 20, 2023

What is the scale on the graph, and how many events are there? Since for a relational database all rows/events are considered the same, I would expect a fetch events query to be getting a bit slower over time. The tokens are limited in size, so indeed I would expect token-related operations to stay constant over time.

@smcvb smcvb added Type: Question Use to signal the issue is a question of how the project works and thus does not require development Status: Information Required Use to signal this issue is waiting for information to be provided in the issue's description. and removed Type: Bug Use to signal issues that describe a bug within the system. labels Apr 12, 2023
@smcvb
Copy link
Member

smcvb commented Apr 12, 2023

Is this something you've seen in the past? Any ideas on how we could investigate this further?

Only when the Event Store was passing sizes could not effectively handle the RDBMS indices anymore.
Note that regular RDBMS solutions of an event store are expected to degrade in performance over time as the size grows.
Allard describes this in a presentation from 2019, explaining why AxonIQ constructed a dedicated Event Store (which you can see here).

However, whether this is the case yes or no isn't clear at the moment.

So, what's the amount of events currently in the RDBMS, @junkdog?
Furthermore, I'm also curious about the scale of the image you've shared.
Additionally, as you're post is already several weeks old, are you able to share whether this increase is still happening?

While waiting for your response, I have added the information required label, as well as replaced the bug label for a question label.
The bug-to-question label switch is mainly a hunch. If we proof something's amiss with AF, we'll obviously reintroduce it.

@smcvb
Copy link
Member

smcvb commented Sep 7, 2023

Closing this issue due to inactivity.
Feel free to add comments at a later stage, @junkdog, when your time allows it!
Based on that, we should be able to reopen the issue and work on it if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Information Required Use to signal this issue is waiting for information to be provided in the issue's description. Type: Question Use to signal the issue is a question of how the project works and thus does not require development
Projects
None yet
Development

No branches or pull requests

3 participants