-
Notifications
You must be signed in to change notification settings - Fork 306
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 of async_hooks scope manager #695
Comments
Unfortunately,
Plugins rely on having the active span available on the current scope. This is ensured by We used to support an alternative scope manager based on a fork of |
One other thing that might be worth testing is if the issue is caused only by |
Thank you for the response @rochdev. We did test with We make extensive use of promises and async/await, and this is a performance sensitive service, so for now we will use dd-trace-js only for the native metrics and disable tracing ( |
Plugins that are usually at the root of the trace can safely be enabled. This usually includes any kind of server such as web frameworks like Express. You can enable these using for example Sorry that we can't do more for now, we really depend on Node to fix the performance issues in |
There was a performance optimization in Node 12 to reduce the memory impact (and thus GC) of @jfirebaugh Can you try with Node >=12 and let me know if you see better results? This would help a lot as I'm trying to see if there is anything we can do to fix or improve this further directly in Node. |
@rochdev thanks for your detailed write up in this issue. just as a note, we are seeing this same issue with using scopes in a lot of promise-y and async code. we deployed Node 12 and then enabled the our DD implementation and there was no performance improvement in Node 12 over Node 10. you can see in the image below, from the mongodb service's perspective, our ability to push load dropped significantly when we had the dd-scope tracing turned on. this test was done with Node 12 deployed. cc @terranblake |
@adityabansod Were you able to confirm that the issue is really |
Closing this one due to inactivity. Feel free to reopen or comment if that makes sense, noting that we also have #1095 open for |
Describe the bug
In our application we noticed a significant performance overhead from using the default
async_hooks
-based scope manager. After addingscope: 'noop'
to our config, we saw the following improvements.CPU usage halved:
Significantly smaller GC pauses, with less variance:
After researching this further, we found that use of
async_hooks
is known to cause significant performance degradation:Are there any official recommendations for configuring the node environment and/or dd-trace-js to reduce the overhead of DataDog's
async_hooks
usage? Is usingscope: 'noop'
a viable approach? What effects would this have on plugins?Environment
The text was updated successfully, but these errors were encountered: