-
Notifications
You must be signed in to change notification settings - Fork 29
feat: cache warmer in memory switchover #237
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
base: main
Are you sure you want to change the base?
feat: cache warmer in memory switchover #237
Conversation
docs/concepts/cache-warmer.mdx
Outdated
|
|
||
| ## In-Memory Switchover Cache Warming | ||
|
|
||
| The in-memory switchover feature provides automatic cache persistence across router restarts, ensuring zero cold starts when deploying new configurations or updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Across schema updates right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, uses the term reload now
docs/concepts/cache-warmer.mdx
Outdated
|
|
||
| 1. **Before Shutdown**: In case of config changes (from hot config reloading), the router extracts all queries from the current plan cache, preserving the queries that were in the planner cache before the cache is cleared for shutdown. | ||
|
|
||
| 2. **During Startup**: The router with the updated config receives the queries from the previous plan cache and uses them to warm up its plan cache before serving traffic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read it as meaning that the router can warm itself up on the first startup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded this part a bit, used reload instead of restart, lmk what you think.
docs/concepts/cache-warmer.mdx
Outdated
|
|
||
| 3. **Result**: The updated router starts with a fully warmed cache, eliminating latency spikes that would normally occur during cold starts. | ||
|
|
||
| When using the in-memory switchover, the first start will still experience a cold start, as there is no prior populated planner cache. Subsequent restarts will benefit from the in-memory switchover. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is conflicting with the paragraph of "during startup"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reworded this part a bit, used reload instead of restart, lmk what you think.
docs/concepts/cache-warmer.mdx
Outdated
|
|
||
| ### When to Use the In-Memory Switchover | ||
|
|
||
| The in-memory switchover can be used either as a fallback method or as a primary method for cache warming. This depends on the router configuration, the defaults provided by the router enables it as a fallback to the Cosmo Cloud CDN cache warmer, which is a Cosmo enterprise feature that needs to be enabled explicitly in Cosmo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just call it in-memory fallback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/concepts/cache-warmer.mdx
Outdated
|
|
||
| ### When to Use the In-Memory Switchover | ||
|
|
||
| The in-memory switchover can be used either as a fallback method or as a primary method for cache warming. This depends on the router configuration, the defaults provided by the router enables it as a fallback to the Cosmo Cloud CDN cache warmer, which is a Cosmo enterprise feature that needs to be enabled explicitly in Cosmo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depends on whether the user is connected to the Comso cloud. I'd not mention if an enterprise is required. The user will see this anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
docs/concepts/cache-warmer.mdx
Outdated
| enabled: true | ||
| ``` | ||
|
|
||
| However, you may want to use the in-memory switchover without the CDN cache warmer, as the CDN is an enterprise feature. To do this, ensure: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You said this already above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the sentence shorter to "To use the in-memory fallback as the primary source", is this what you suggested?
Adds docs for the in memory switchover fallback, depends on PR wundergraph/cosmo#2445