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

PYIC-7910 Preload templates for all pages #1779

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Joe-Edwards-GDS
Copy link
Contributor

@Joe-Edwards-GDS Joe-Edwards-GDS commented Jan 8, 2025

Proposed changes

What changed

Pre-render all pages on startup, to ensure they are cached before serving requests

Why did it change

We see a high rate of 503s when spinning up new containers during a load test, suggesting that new containers are seeing a high event loop latency.

One possible explanation is that this is occurring when loading uncached templates from disk (as Nunjucks does this synchronously). By preloading the templates, we should be able to keep the event loop latency low once serving requests.

Issue tracking

@Joe-Edwards-GDS Joe-Edwards-GDS force-pushed the pyic-7910-preload-templates branch from 1e38de1 to e491fee Compare January 8, 2025 10:01
Copy link

sonarqubecloud bot commented Jan 8, 2025

@Joe-Edwards-GDS
Copy link
Contributor Author

This doesn't appear to have had the desired effect, so parking this for now

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.

1 participant