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

Slow GraphQL performance after upgrading to v3.5.3 #13216

Closed
glesys-andreas opened this issue Jul 19, 2023 · 7 comments
Closed

Slow GraphQL performance after upgrading to v3.5.3 #13216

glesys-andreas opened this issue Jul 19, 2023 · 7 comments
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@glesys-andreas
Copy link

NetBox version

v3.5.6

Python version

3.9

Steps to Reproduce

  1. create a vlan with tag 999 and add it to a vlan group, does not matter which one.
  2. Create a bunch of prefixes about 400 - 500:
    [{"prefix": "10.0.0.0/24", "tenant": "Cyberdyne Systems", "status": "active", "vlan": 999}, {"prefix": "10.0.1.0/24", "tenant": "Cyberdyne Systems", "status": "active", "vlan": 999}.....]
  3. Run this query:
query allActivePrefixes {
	prefix_list(status: "active", family: 4) {
		prefix
		description
		tenant {
			name
		}
		vlan {
			group {
				name
			}
			vid
		}
	}
}

Expected Behavior

In our prod environment running v3.5.2 this query takes about 200-400 ms and contains about 1700 prefixes,

Observed Behavior

Test 1:
In our test environment running v3.5.6 the same query takes about 6-8 seconds and contains the same data as prod (1700 prefixes).

Test 2:
Created about 500 vlans on demo.netbox.dev ( currently v3.5.6 ) and got about the same response time here: 6-8 seconds.

The problem started when we upgraded to v3.5.3

@glesys-andreas glesys-andreas added the type: bug A confirmed report of unexpected behavior in the application label Jul 19, 2023
@kkthxbye-code
Copy link
Contributor

Is it possible for you to verify that 3.5.0 or 3.5.1 is also slow? Looking at the changes, 3.5.2 is the only release which has the upgraded graphene-django version (3.0.2) which broke the graphql explorer. It was reverted (to 3.0.0) in 3.5.3.

For context:

#12762
#12762 (comment)

Upgrading graphene-django would require fixing the graphql explorer, not that it's necessarily hard, someone just needs to do it.

@kkthxbye-code kkthxbye-code added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Jul 23, 2023
@glesys-andreas
Copy link
Author

Ran the same test on a host running version 3.5.0 .
The query takes about 5 seconds with 1600 prefixes and with no other load on the system.

@jeremystretch
Copy link
Member

@glesys-andreas have you been able to identify any changes that would improve performance?

This may become a moot point if we adopt Strawberry for v4.0 (see #9856).

@glesys-andreas
Copy link
Author

Hi, We are currently running 3.6.0 on our test environment and we are experiencing the same (slow) performance there.

Would be nice to see it implemented. We use the GraphQl API a lot so it would really make things a bit snappier :)

@jeremystretch

This comment was marked as off-topic.

@glesys-andreas

This comment was marked as off-topic.

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation severity: medium Results in substantial degraded or broken functionality for specfic workflows and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Oct 5, 2023
@jeremystretch
Copy link
Member

I'm going to close this out as no specific changes have been proposed. If anyone would like to continue researching potential optimizations, please feel free to do so, and submit a new issue detailing the specific changes to be made if you find something.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
severity: medium Results in substantial degraded or broken functionality for specfic workflows status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants