Skip to content

infra(app): one nginx instance, concurrency 80 - #11829

Merged
MarkusNeusinger merged 3 commits into
mainfrom
infra/app-single-instance
Sep 11, 2026
Merged

infra(app): one nginx instance, concurrency 80#11829
MarkusNeusinger merged 3 commits into
mainfrom
infra/app-single-instance

Conversation

@MarkusNeusinger

Copy link
Copy Markdown
Owner

Summary

  • anyplot-app runs as a single instance with concurrency 80 (was max 3, concurrency 15; min-instances stays 0). A static nginx never needed a second instance for capacity — its files answer in milliseconds and it sits at 15 MiB p99 of 512Mi — yet every crawler burst filled the 15 slots and started one or two more instances (50 AUTOSCALING starts in the ten days to 2026-09-10), because nginx holds a proxied bot request open for as long as the API takes to answer. One forged-UA burst on 2026-09-09 filled the instance and started two more. With the API on one warm instance (infra(api): single instance, non-blocking prewarm, OG renders off the loop #11828) those waits are milliseconds, and one nginx with 80 slots absorbs the burst without a 0.26 s cold start.
  • Owner decision 2026-09-11: one instance per service in both projects (the sibling PR in kurrentschrift does the same there). If 429s ever appear, max 2 is the next step.
  • docs/reference/performance.md still says max 3 / concurrency 15 for the frontend after this PR: infra(api): single instance, non-blocking prewarm, OG renders off the loop #11828 edits the same table row, so the row is updated in a follow-up once both have merged, to keep the two PRs from conflicting.

Plan

N/A — measurements in the Todoist task "Nachprüfen: merkt jemand, dass anyplot-app auf null skaliert?" (closed 2026-09-10 with the numbers) and in #11828.

Test plan

  • app/cloudbuild.yaml parses; the deploy step carries --min-instances 0 --max-instances 1 --concurrency 80
  • uv run python -m tools.changelog check --base origin/main passes
  • No image or nginx change: the app image and the origin-gate smoke in CI are unaffected; the candidate smoke in Cloud Build probes the new revision before traffic moves
  • After merge: Cloud Build deploy-app green; gcloud run revisions describe on the promoted revision shows maxScale 1, containerConcurrency 80; then two weeks of run.googleapis.com/request_count by response_code (zero 429s expected) and instance-start logs (AUTOSCALING starts should stop)

🤖 Generated with Claude Code

https://claude.ai/code/session_01CELiZYpFBQc5bncjWXYrue

anyplot-app goes from max 3 / concurrency 15 to max 1 / concurrency 80; min stays 0. A static nginx never needed a second instance for capacity, yet every crawler burst filled the 15 slots and started one or two more instances (50 AUTOSCALING starts in the ten days to 2026-09-10), because nginx holds a proxied bot request open for as long as the API takes to answer. With the API on one warm instance those waits are milliseconds, and one nginx with 80 slots absorbs the burst without a cold start. Owner decision 2026-09-11: one instance per service in both projects.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CELiZYpFBQc5bncjWXYrue
Copilot AI balanced review requested due to automatic review settings September 11, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The production capacity and deployment configuration change requires final human review.

Pull request overview

Caps the frontend Cloud Run service at one instance and raises concurrency to 80.

Changes:

  • Sets max-instances to 1 and concurrency to 80.
  • Documents the operational rationale in configuration and changelog.
File summaries
File Description
app/cloudbuild.yaml Updates Cloud Run scaling settings.
changelog.d/app-single-instance.md Records the infrastructure change.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/cloudbuild.yaml Outdated
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MarkusNeusinger
MarkusNeusinger merged commit 8a62b2c into main Sep 11, 2026
14 checks passed
@MarkusNeusinger
MarkusNeusinger deleted the infra/app-single-instance branch September 11, 2026 20:00
MarkusNeusinger added a commit that referenced this pull request Sep 13, 2026
…11830)

## Summary
- `docs/reference/performance.md`: the frontend row of the
infrastructure table now says max-instances=1, concurrency 80, matching
`app/cloudbuild.yaml` after #11829. #11828 and #11829 edited the same
row from different branches, so this line was left behind on purpose to
keep the two from conflicting.

## Plan
N/A

## Test plan
- [x] `uv run python -m tools.changelog check --base origin/main` passes
- [x] Docs-only change; no code touched

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CELiZYpFBQc5bncjWXYrue

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants