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

feature: introspection: don't prefill the introspection cache anymore. #1517

Merged
merged 3 commits into from
Aug 17, 2022

Conversation

o0Ignition0o
Copy link
Contributor

fixes: #1516, #1466

Since @bnjjj s refactoring on introspection, we don't need to cache well known introspection queries.

Pros: Caching those queries and responses can lead to high memory footprints, especially on very large schemas.
Cons: The first introspection query will take a bit longer (~130ms on my machine) than the cached one (~2ms on my machine)

The default introspection cache size is now 5, and cannot be configured. 5 has been chosen because we do not expect local developers to run tools that need more than 5 different introspection queries with < 3ms latency requirements.

fixes: #1516, #1466

Since @bnjjj s refactoring on introspection, we don't need to cache well known introspection queries.

Pros: Caching those queries and responses can lead to high memory footprints, especially on very large schemas.
Cons: The first introspection query will take a bit longer (~130ms on my machine) than the cached one (~2ms on my machine)

The default introspection cache size is now 5, and cannot be configured. 5 has been chosen because we do not expect local developers to run tools that need more than 5 different introspection queries with < 3ms latency requirements.
@o0Ignition0o o0Ignition0o requested review from Geal, SimonSapin, garypen, bnjjj, abernix and BrynCooke and removed request for Geal and SimonSapin August 16, 2022 14:43
Copy link
Contributor

@garypen garypen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One option to consider, but it really is just a NIT.

apollo-router/src/cache/storage.rs Outdated Show resolved Hide resolved
@o0Ignition0o o0Ignition0o requested a review from garypen August 16, 2022 16:55
Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left a changelog suggestion!

NEXT_CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Jesse Rosenberger <git@jro.cc>
@o0Ignition0o o0Ignition0o enabled auto-merge (squash) August 17, 2022 06:48
@o0Ignition0o o0Ignition0o merged commit a366da9 into main Aug 17, 2022
@o0Ignition0o o0Ignition0o deleted the igni/dont_prefill_introspection_cache branch August 17, 2022 07:09
@Geal Geal mentioned this pull request Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introspection: Change the caching behavior
4 participants