Skip to content

fix(backend): bump storage_executor 64→96 — queue exceeds 300 threshold - #7380

Merged
beastoin merged 4 commits into
mainfrom
fix/storage-executor-96-7376
May 19, 2026
Merged

beastoin merged 4 commits into
mainfrom
fix/storage-executor-96-7376

Conversation

@beastoin

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #7378. Bumps storage_executor from 64 → 96 workers.

Evidence from T+2h post-deploy monitoring (mon):

  • backend storage max queue: 336 (threshold 300)
  • backend-sync storage max queue: 608
  • 100% utilization sustained at 64 workers — zero headroom
  • 202 p99 latency at 4.7s, approaching 5s threshold
  • 3x 504s appeared
  • Avg queue ~30 (steady-state handles fine) but spikes 300-600+ during bursts

64 workers handles steady-state but cannot absorb traffic spikes. 96 provides ~50% headroom over observed peaks. Codex consultation from #7376 identified 64-96 as the practical ceiling for storage (I/O-bound GCS work).

All other pools from #7378 are confirmed resolved:

  • postprocess (24w): 75% util, zero queue
  • sync (16w): resolved, queue 4
  • llm (6w): zero queue
  • db (24w): zero Firestore contention

Closes #7376.

Test plan

  • test_executors.py — 24 pass
  • test_async_http_infrastructure.py — executor tests pass (assertion updated 64→96)
  • test_sync_v2.py — executor worker count assertion updated
  • Post-deploy: verify storage queue stays <100 during peak hours (17:00-21:00 UTC)
  • Post-deploy: verify 202 p99 latency <2s

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bumps storage_executor from 64 to 96 workers in response to observed queue saturation (peak queue depth 336–608, threshold 300) at 64 workers, and updates the corresponding test assertions and documentation.

  • backend/utils/executors.py: storage_executor max_workers changed from 64 → 96; no other executor pool is touched.
  • Tests (test_async_http_infrastructure.py, test_sync_v2.py): Assertions updated from 64 → 96 to keep the test suite consistent.
  • backend/CLAUDE.md: Inline documentation updated to reflect the new worker count.

Confidence Score: 5/5

Safe to merge — the change is a single integer bump in a well-monitored executor pool, backed by production queue data and within the documented practical ceiling for I/O-bound GCS work.

All four files are updated consistently: the executor definition, both test files asserting the worker count, and the architecture documentation. The bump is evidence-based (observed peak queues of 336–608 at 64 workers), keeps total thread budget reasonable for I/O-bound workloads, and has no surrounding logic changes that could introduce regressions.

No files require special attention.

Important Files Changed

Filename Overview
backend/utils/executors.py Single-line change: storage_executor max_workers bumped from 64 → 96; all surrounding logic unchanged.
backend/tests/unit/test_async_http_infrastructure.py Test name and assertion updated to match new worker count (64→96); no logic changes.
backend/tests/unit/test_sync_v2.py Assertion message updated from 64 to 96 to match the new worker count.
backend/CLAUDE.md Documentation updated to reflect new storage_executor worker count (64w → 96w).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming GCS Request] --> B{storage_executor queue}
    B -- "≤96 active workers" --> C[Worker thread\nGCS upload/download]
    B -- "queue depth >300\n@64 workers" --> D[Queue saturation\n504 errors / p99 spike]
    C --> E[GCS / Cloud Storage]
    B -- "96 workers\n~50% headroom over peak" --> F[Worker thread\nGCS upload/download]
    F --> E
Loading

Reviews (1): Last reviewed commit: "test(backend): update sync_v2 storage po..." | Re-trigger Greptile

@beastoin beastoin left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

lgtm

@beastoin
beastoin merged commit 649488f into main May 19, 2026
3 checks passed
@beastoin
beastoin deleted the fix/storage-executor-96-7376 branch May 19, 2026 09:10
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.

Tune executor pool sizing based on 48h production monitoring

1 participant