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 on startup #8995
Comments
Hello @ruslansuprun thank you for reporting this issue. Can you tell us what products or environment variables you have enabled? For example |
Sure
|
Thank you, This CPU spike, does it also happen if you disable The spike does not happen in 2.8.0 with the same env variables? |
It's happening when
|
We've upgraded from |
@ruslansuprun Definitely looks like a profiling issue. Since you're on a recent version of 2.7/2.8, could you try enabling the |
@sanchda so this new env variable should be added along with |
@ruslansuprun It's in addition to. It modifies the behavior of the profiler, but the profiler won't be enabled without specifying it explicitly. |
@sanchda tried this, small improvements are in place, but still CPU usage on start is too high 😢 |
Did some head-scratching over this. @ruslansuprun, if you're up for another experiment, I see that in some cases the profiler startup time can be negatively impacted by code provenance ("My Code" in the UI). If you set If it doesn't help, then I'd be very interested in trying to characterize how the profiler is wasting time. You may not be the only one with this issue. |
@sanchda sorry for a long response, will test it in few days and will return back with feedback |
@sanchda hi |
We are running 2 services Second on is using uvicorn with 10 workers per container, workers amount is set by env variable |
Summary of problem
During start of our applications CPU usage is going 3x from usual utilization, after few mins it returns back to normal state, but it does affect our autoscaling.
When we are starting app without
ddtrace-run
command CPU usage spikes on start does not appear.Python version:
3.12
Which version of dd-trace-py are you using?
2.8.1
Which version of pip are you using?
24.0
Which libraries and their versions are you using?
`pip freeze`
How can we reproduce your problem?
Run big app with
ddtrace-run
What is the result that you get?
High CPU usage on application start
What is the result that you expected?
CPU usage spike on start is not happening or at least decreased as much as possible
The text was updated successfully, but these errors were encountered: