-
Notifications
You must be signed in to change notification settings - Fork 103
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
GraphQL (graphene) transactions are slow with newrelic from v6.6.0.162 and above #605
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey @trimailov; is this still an issue? Have you been able to recreate a sharable environment to validate this? |
It's still an issue, though have no shareable environment at hand :( |
@trimailov without a sharable environment this will be difficult for our team to debug. I will close this ticket until we have more data, additional users are experiencing the issue, or we have an environment our team can work with. |
I believe I am having this issue as well. I also don't have a sharable environment I can offer at this point, but I added new relic to a graphene application today and found that all graphql requests are 3-6x slower. An example request goes from taking about 2s without newrelic to 8-10s with new relic. It seems like it is a problem even with a lot of the new relic agent disabled. Currently I disable all these things in my
Is there more I could try disabling? If I set |
@Ak-x , may I request that this issue be reopened? Here's an example project where I've tried to reproduce the issue: https://github.com/tdg5/newrelic-python-agent-graphene-issue#results-with-new_relic_license_key-ouch I was able to reliably achieve a slowdown >10x for the 99 percentile. I will try to simplify the example further as time allows. Thanks to @Anton-Karpenko for putting together the basic application structure so I could try to reproduce the problem! I spent a couple of hours looking for clues in one of the packages involved, but didn't find a smoking gun. If I can offer any additional guidance or assistance, please let me know. |
I think, this is still an issue, we are using strawberry with fastapi, facing same problem. response time increased from ~50ms to ~300ms |
Ultimately the following settings in newrelic.ini fixed the performance regression for us. For a large response with many thousands of graphql objects and nesting we achieved a x3 improvement on latency.
|
Description
Upgrading anything above v6.6.0.162 will make our GraphQL endpoints slower by some margin.
From stable ~30ms to hovering between 50-100ms.
Also CPU and RAM utilization is also noticable - RAM use increased by ~20% from previous total and CPU use is additional ~5%. So for example if we used 50% RAM - we now use 60% and if we used 20% CPU - we now use 25% CPU.
I have tried to run these newrelic agent versions:
v7.16.0.178
,v7.14.0.177
,v6.10.0.165
,v6.6.0.162
- all impacted response times in same way.I was upgrading from:
v6.2.0.156
and settled atv6.4.4.161
which is latest version without graphql support (to my knowledge), but it is not impacting my applications performance.Also - important to note that
<= v6.4.4.161
reports graphql transactions as web transaction named as GraphQL endpoint view class (i.e. Django view class that serves GraphQL API), which is expected, though versions with GraphQL support (>v6.6.0.162
) are reporting graphql transactions asgraphene.types.resolver:dict_or_attr_resolver
.Expected Behavior
There shouldn't be noticable changes in our web servers response times and CPU/RAM utilization.
Troubleshooting or NR Diag results
Output from NR Diag. I think it's all OK, as .NET errors or Java warnings are not relevant for the project.
Steps to Reproduce
I will try to create minimal example application to be able to reproduce this, but it's a
Django
application withgraphene-django
used for implementing GraphQL API, with minimaldjangorestframework
endpoint to serve it.Your Environment
Basic app package requirements (
python 3.9.2
):Web app is served with
gunicorn
and started withnewrelic-admin
:To my understanding
newrelic.ini
is not configured beyond default, setting up API key and enabling environments for staging and production.Additional context
Looking at newrelic's transaction details I notice that the mentioned
graphene.types.resolver:dict_or_attr_resolver
is called hundreds of times.I am not sure if this is newrelic's bug or (more likely) misimplementation of our graphene application that breaks newrelic.
The text was updated successfully, but these errors were encountered: