Skip to content
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

Increased CPU usage since 8.11.0 / 8.10.1 release #927

Closed
khink opened this issue Sep 28, 2023 · 5 comments · Fixed by #970
Closed

Increased CPU usage since 8.11.0 / 8.10.1 release #927

khink opened this issue Sep 28, 2023 · 5 comments · Fixed by #970

Comments

@khink
Copy link

khink commented Sep 28, 2023

After we upgraded from 8.10.0 to 8.11.0, we noticed an increase in CPU usage:
image
image

Yesterday, we went back to 8.10.0 on TST and it seemed to reduce CPU usage:
image

I'm hoping to get some pointers for profiling this issue, i can spend some time. So far we seem to be the only ones experiencing this, although #918 might be related.

From https://docs.newrelic.com/docs/release-notes/agent-release-notes/python-release-notes/python-agent-81100/ it's not clear which change may have caused this. It might also have been in 8.10.1, which we skipped. We also upgraded to 9.0.0, which shows the same increased CPU usage.

Your Environment

We use newrelic in an e-commerce application based on Django-Oscar and Django REST Framework.

We are hosting this on Amazon ECS, graphs are from its "Health and service" dashboard.

We have TST, ACC and PRD environments, and we see the issue on all three envs. The TST env is logging at DEBUG level, so its logs might contain useful info, if we knew what to look for. Searching on "newrelic" only gives messages like newrelic.config DEBUG - register module ('rest_framework.views', 'newrelic.hooks.component_djangorestframework', 'instrument_rest_framework_views'), which happens after the application starts up.

@natemoser
Copy link

natemoser commented Oct 3, 2023

I posted our findings on the #918 issue you linked to. We're seeing similar things between 8.10.0 and 8.10.1.

I was able to use New Relic's thread profiler to show that the increase was coming from additional time in importlib:metadata, which led me to suspect the newrelic update, which led me here.

@whyscream
Copy link

whyscream commented Oct 5, 2023

Commit that introduced the problem (I guess): 7d76243
Related:: #878 and #862

@alexandre-paroissien
Copy link

Noticed the same issue, seems it was only affecting celery pods

The CPU usage went up significantly when upgrading the library, and back down after downgrading

image

@alexandre-paroissien
Copy link

Upgraded to 9.2.0 and the issue is no longer there 👍

image

@khink
Copy link
Author

khink commented Dec 5, 2023

Same here, we upgraded to 9.2.0 this past week (from 8.10.0 which we pinned) and CPU use is normal. Thanks to all contributors!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants