Repository navigation
Prefetch grid files for cellpack studio - #482
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
An unavailable grid URL can abort server initialization, preventing all endpoints—including health checks—from starting and blocking prefetching of the remaining grids.
1 open issue
What changed in this PR
This PR warms the server’s grid cache at startup to reduce first-request delays for Cellpack Studio’s example recipes.
Changes:
- Fetch example recipe references from Firebase and cache their grid files locally.
- Run prefetching during application initialization, before accepting packing requests.
| File | Description |
|---|---|
docker/server.py |
Adds example-grid prefetching and invokes it during server startup. |
Review effort: Balanced
ascibisz
marked this pull request as ready for review
November 4, 2026 22:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
Graham ran into some performance issues and failures last week when running the cellpack studio. Upon further investigation, we noticed a CPU spike on our server at that time, which caused major performance for other requests at that time. After traffic died down, everything went back to normal. There are two takeaway problems that we wanted to address:
Solution
When a new server instance starts up, proactively get the grid files for the example recipes on firebase (which are the recipes available in the recipe selection dropdown on cellpack studio) before we start accepting requests for new packings. This is only 4 grid files right now, so it takes like 10 seconds on startup, and it will allow for more consistent performance for users.