Comments (12)
Hey @adinauer , thank's for looking into that!
Do you do any manual capturing of errors, breadcrumbs etc.?
We don't create/capture/use breadcrumbs. We catch exceptions above the controller's layer in the @ControllerAdvice
class -> @ExceptionHandler
methods.
Other interaction with the Sentry API?
Nope.
Are any/many exceptions thrown and recorded by Sentry?
Not many, during a few days, we got <100 occurrences of 3 different Exceptions
Roughly how many requests is the server seeing?
Single pod/instance handles roughly up to 150 RPS
Do you use CRONS?
Nope, at least not directly in our code (not sure if it's used inside Spring itself)
I just set sentry.enable-aot-compatibility=true
, will report back tomorrow with the result.
from sentry-java.
@RobicToNieMaKomu thanks for opening this issue. We'll take a look and update here.
from sentry-java.
@RobicToNieMaKomu I can confirm, we're using up more memory on startup but after manually triggering GC, it ends up roughly the same.
How I tested
- I fired up our Spring Boot 3 Webflux sample
- let it startup for a bit then manually triggered GC in
visualvm
a couple times - sent some requests in using
wrk -t2 -c4 -d30s -H "Authorization: Basic dXNlcjpwYXNzd29yZA==" http://127.0.0.1:8080/todo-webclient/1
. This sends ~ 4k requests in 30s:
Running 30s test @ http://127.0.0.1:8080/todo-webclient/1
2 threads and 4 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 28.21ms 9.48ms 174.51ms 93.47%
Req/Sec 72.24 11.44 101.00 68.91%
4325 requests in 30.03s, 532.18KB read
Requests/sec: 144.01
Transfer/sec: 17.72KB
- manually triggered GC a couple times again
- reran
wrk
- manually triggered GC a couple times again
The endpoint does not record any errors but did create transactions and spans (when Sentry was enabled).
Results
So with Sentry enabled the server is consuming a lot more memory on startup but it is able to free that back up. Will keep investigating.
Questions
Can you please tell us a bit about your usage of Sentry on the screenshots you provided?
- Do you do any manual capturing of errors, breadcrumbs etc.?
- Other interaction with the Sentry API?
- Are any/many exceptions thrown and recorded by Sentry?
- Roughly how many requests is the server seeing?
- Do you use CRONS? There's another potential memory problem there, see #3165
from sentry-java.
@RobicToNieMaKomu if you're not using any of our AOP features (@SentryTransaction
, @SentrySpan
, @SentryCheckIn
annotations) you could try to disable those using sentry.enable-aot-compatibility=true
and see if that helps lower the initial memory consumption. From my testing it only used ~ 1/3 of memory on startup this way.
from sentry-java.
Here's another screenshot showing memory consumption with above mentioned test procedure and sentry.enable-aot-compatibility=true
:
from sentry-java.
@RobicToNieMaKomu you can also try playing with these settings:
sentry.logging.minimum-event-level=info
sentry.logging.minimum-breadcrumb-level=debug
and you could drop all breadcrumbs from BeforeBreadcrumbCallback
. Should be as simple as providing a spring bean that always returns null
from Breadcrumb execute(@NotNull Breadcrumb breadcrumb, @NotNull Hint hint)
.
from sentry-java.
This is what it looks like after applying these properties:
sentry.enable-aot-compatibility=true
sentry.logging.minimum-event-level=info
sentry.logging.minimum-breadcrumb-level=debug
and BeforeBreadcrumbCallback -> null
:
Maybe memory consumption became slightly smaller, but it still has a significant impact.
from sentry-java.
@RobicToNieMaKomu can you please provide a sample that allows us to reprodue the issue, maybe by forking the repo and adding to our Spring Boot 3 Webflux Sample. I'm assuming you're using additional Spring features, settings or other libraries that could cause this when combined with Sentry.
and BeforeBreadcrumbCallback -> null
I'm not sure we're on the same page here. Did you provide a callback that returns null
(this is what is needed to drop all breadcrumbs) or did you set the callback to null
(this is the default behaviour of not dropping breadcrumbs)?
sentry.logging.minimum-breadcrumb-level=debug
I meant to suggest you can increase the level to not have as many breadcrumbs but it's not that relevant if you're dropping all breadcrumbs anyways or limit breadcrumb count to 1.
from sentry-java.
Oh and are you using any special garbage collector settings?
from sentry-java.
Hey @RobicToNieMaKomu, did you had some time to look into the questions from above^, by any chance?
from sentry-java.
@adinauer I'm sorry, I can't fork the repo (NDA) and don't have enough time to come up with PoC now.
The simplified stack we're using in that service:
<java.version>17</java.version>
<lombok.version>1.18.30</lombok.version>
<springboot-cloud.version>2022.0.5</springboot-cloud.version>
<resilience4j.version>2.1.0</resilience4j.version>
<protobuf-java.version>3.22.2</protobuf-java.version>
<awaitility.version>4.2.0</awaitility.version>
Besides, it heavily uses Redis (spring-boot-starter-data-redis-reactive
dependency of SB 3.1.8).
I'm not sure we're on the same page here. Did you provide a callback that returns null (this is what is needed to drop all breadcrumbs) or did you set the callback to null (this is the default behaviour of not dropping breadcrumbs)?
I provided a callback that returns null.
are you using any special garbage collector settings?
Java options: -Xss512k -XX:+UseZGC -XX:MaxDirectMemorySize=64m -XX:ReservedCodeCacheSize=120M
from sentry-java.
Thanks for the update.
from sentry-java.
Related Issues (20)
- Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6f276510 in tid 14600 (SentryAsyncConn) HOT 10
- Remove sentry-android-okhttp integration
- Overwrite TTFD measurement when API called too early HOT 1
- Uncaught exceptions do not go through BeforeSendCallback on Android HOT 3
- Some Sentry XML options (eg.: traces.user-interaction.enable) cause a C++ SIGSEV SIGFAULT error on API 21 HOT 5
- Docs: Data Collected section regarding PII for Android
- Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ HOT 5
- Missing documentation leads to uncertainty HOT 2
- Expose SentryInstrumentation as bean with @ConditionalOnMissingBean for easy configuration HOT 4
- Allow user to hook into Breadcrumb in SentryInstrumentation HOT 2
- Contexts.setTrace can't be null HOT 1
- Ability to filter by "user-perceived" unhandled exceptions/fatal errors generated by the Kotlin SDK HOT 5
- Make it possible to disable dedupe filter in spring boot HOT 6
- ApplicationNotResponding HOT 1
- Android profiler causes ANR
- SentryLogcatAdaptor consumes unnecessary time on main thread HOT 2
- How to implement SSL Pinning in Android HOT 5
- Performance powered by OpenTelemetry (POTel)
- ANR on NativeModuleListLoader.nativeLoadModuleList
- Detect if Sentry.init is called on Android instead of SentryAndroid.init HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-java.