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

Crons lead to unusual 10% load increase #3165

Open
Tracked by #11
Angelodaniel opened this issue Jan 25, 2024 · 8 comments
Open
Tracked by #11

Crons lead to unusual 10% load increase #3165

Angelodaniel opened this issue Jan 25, 2024 · 8 comments
Assignees
Labels
Platform: Java Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working

Comments

@Angelodaniel
Copy link
Member

Angelodaniel commented Jan 25, 2024

Integration

sentry-spring-boot-starter-jakarta

Java Version

Spring boot 3.2.2

Version

7.2.0

Steps to Reproduce

spring boot application 3.2.2
annotation: @SentryCheckIn(value = "x", heartbeat = true)
SDK version: io.sentry:sentry-spring-boot-starter-jakarta:7.2.0
Looks like that the gc_memory_promoted_bytes_total is much higher than usual

Expected Result

Not a big increase in load increase

Actual Result

I’ve noticed that enabling the cron SDK in our Spring Boot application leads to an unusual 10% load increase on one of the three instances in our cluster. This behavior is apparent even when the scheduler isn’t active, as it’s set to run in the morning.
Screenshot 2024-01-25 at 15 18 29

┆Issue is synchronized with this Jira Improvement by Unito

@Angelodaniel Angelodaniel added Type: Bug Something isn't working Platform: Java Sync: Jira apply to auto-create a Jira shadow ticket labels Jan 25, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 25, 2024
@adinauer
Copy link
Member

@Angelodaniel do you know if other Sentry annotations have been used before (e.g. @SentrySpan, @SentryTransaction) or if crons is the first AOP feature in use?

I'll try to reproduce and see if there's something we can do about it.

@adinauer
Copy link
Member

@Angelodaniel is there only a single @Scheduled method that runs in the morning and nothing else?

@adinauer
Copy link
Member

@Angelodaniel does this only happen when the server has been running for a while or can it be observed immediately?

@adinauer
Copy link
Member

@Angelodaniel is the method annotated with @SentryCheckIn also called from other places? e.g. when a request is performed?

sorry for the many separate messages

@adinauer
Copy link
Member

adinauer commented Jan 26, 2024

As a workaround, you could try to use CheckInUtils.withCheckIn instead of the annotation and see if that helps. See https://docs.sentry.io/platforms/java/crons/#check-ins-recommended

If that alone doesn't work, you might have to combine it with sentry.enable-aot-compatibility=true to disable AOP features. Be aware though this also disabled other Sentry annotations like @SentryTransaction and @SentrySpan.

@stockii
Copy link

stockii commented Jan 29, 2024

Hello, I can jump in here and answer your questions @Angelodaniel

@Angelodaniel do you know if other Sentry annotations have been used before (e.g. @SentrySpan, @SentryTransaction) or if crons is the first AOP feature in use?

I'll try to reproduce and see if there's something we can do about it.

Only the @SentryCheckIn was used.

@Angelodaniel is there only a single @scheduled method that runs in the morning and nothing else?
No we have multiple Scheduler running, but only one got the @SentryCheckIn Annotation.

@Angelodaniel is the method annotated with @SentryCheckIn also called from other places? e.g. when a request is performed?
nope, only via Scheduler Annotation

@Angelodaniel does this only happen when the server has been running for a while or can it be observed immediately?

immediately

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 29, 2024
@adinauer
Copy link
Member

@stockii thank you for your answers, we'll investigate and report back here.

@adinauer
Copy link
Member

@stockii so far I haven't been able to confirm the load increase on our Spring Boot 3 sample. Have you had any luck with the workaround in #3165 (comment) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Java Sync: Jira apply to auto-create a Jira shadow ticket Type: Bug Something isn't working
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

3 participants