-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Performance issues caused by Sentry.Handlers.requestHandler
middleware, about 40% higher latency
#7676
Comments
A bit context about server internals: It's an express.js server using "apollo graphql". Looking at chrome devtools profile alot of time was spent in node:domain Maybe this related to pattern where almost every field returned by server create new promise, something like: const getDataThen = fn => (id, _, { dataSources }) =>
dataSource.getById(id).then(res => fn(res, dataSources))
// ...
display_order: getContractThen(obj => obj.display_order),
hidden: getContractThen(obj => obj.hidden),
id: id => id,
info: getContractThen(obj => obj.info),
market_id: getContractThen(obj => obj.market_id),
market: getContractThen(obj => obj.market_id),
name: getContractThen(obj => obj.name),
} I imagine with ~1-3MB of response this will create huge amount of promises internally? |
Hey @olessavluk - domains have a hard time dealing with the memory pressure of a large amount of promises, so that is probably the reason why this is happening. Can you extract the multiple We have an open issue to migrate away from domains and use |
Opened #7691 - we're going to start exploring it next week. |
Hey @olessavluk, could you try upgrading to the We switched from using |
Looks good, much better than previous version 👍 |
Great! We're gonna make a couple more changes to improve perf here, so gonna leave this open for now. Stay tuned! |
Alright there were some changes made to stacktrace parsing and some other code - so going to close this for now. We'll keep monitoring and improving this though! |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using? If you use the CDN bundles, please specify the exact bundle (e.g.
bundle.tracing.min.js
) in your SDK setup.@sentry/node
SDK Version
7.45.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
added
app.use(Sentry.Handlers.requestHandler())
Expected Result
No "visible" impact on server cpu usage & response latency
Actual Result
CPU usage slightly increased, significant increatese in latency
The text was updated successfully, but these errors were encountered: