-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
High CPU usage when attach_stacktrace=true #597
Comments
Are you capturing a lot of errors or transactions during an average request? I believe the problem here is simply that Put simply, the first step of unwinding the stack trace involves using / accessing unwind info from all the binaries the call stack goes through. This process is just slow in itself. The Long story short, we should be able to take half of the pain here away by using |
Lets reopen this, as this is a good thing to eventually do, maybe not right away though :-) |
Hi @Swatinem, I think my question is related to this: we're finding that stacktrace generation (specifically symbolication) is causing memory usage of the process to jump significantly — from < 2MB to > 400MB, in a moderately complex process. So I think like the original discussion above, we'd like a way to disable symbolication even when debug info is present. It seems like disabling the If you have any pointers on where this change would be made, we're happy to submit a PR or utilize a fork with the change. We're specifically using EDIT: I guess this isn't exactly the right place for my request, as our issue is not specific to |
I had another look at this, and the situation is still quite bad. Due to not having stable accessors for either the However, if you are relaying on If you are comfortable maintaining a fork of that, you can just remove the lazy resolution of the frames here: That is however not possible with Figuring out a way to disable the lazy However the roundtrip through |
It looks like being able to not collect backtraces for unsampled transactions may help? |
Totally agree. That was changed quite a while back to follow the SDK spec. I was raising concerns about perf implications way back when: #477 (review) The idea was to have all of the different hooks run before sampling, so that custom code can react accordingly. |
Environment
actix-web
What version are you running? Etc.
0.31.5
Steps to Reproduce
When setting up sentry to attach stack traces, as below:
We see a really high CPU usage (up to ~800% on my dev linux machine with 16 cores) when using a load test tool like vegeta:
For example,
A bunch of requests actually don't even complete (timeout) because the CPU usage spikes so high. This all goes away when making
attach_stacktrace = false
.It's important to note that we have a large enum error return type, but it's been boxed:
Any idea what's going on here or how we can still get stack traces?
The text was updated successfully, but these errors were encountered: