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

Extremely slow parse times can cause the router to stop serving requests #5313

Closed
xuorig opened this issue Jun 1, 2024 · 0 comments · Fixed by #5347
Closed

Extremely slow parse times can cause the router to stop serving requests #5313

xuorig opened this issue Jun 1, 2024 · 0 comments · Fixed by #5347
Assignees

Comments

@xuorig
Copy link
Contributor

xuorig commented Jun 1, 2024

The version of apollo-compiler used by router has a perfomance issue in validation, which combined with large schemas and queries with a lot of fragment spreads can cause devastatingly slow parsing times (in seconds). I've opened an issue on apollo-compiler which contains more details about the problem.

Combined with the fact parsing is executed between await points and is blocking (for potentially seconds), this can cause the router's async runtime to completely fall apart and not being able to respond to any queries for minutes. I've opened a PR to run parsing through spawn_blocking instead of blocking a worker. This is especially concerning on schema reloads, where contention is high.

Both issues most likely need to be fixed to maintain good performance on schema reloads when it comes to parsing. Additionally, it might be worth thinking about how the implementers_map (apollo-compiler issue) can be cached through router reloads.

@xuorig xuorig changed the title Extremely slow parse times can cause the router to stop service requests Extremely slow parse times can cause the router to stop serving requests Jun 3, 2024
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.

2 participants