Skip to content

perf(selfhost): default QUEUE_CONCURRENCY to 4 so PR bursts drain in parallel - #1480

Merged
JSONbored merged 1 commit into
mainfrom
claude/queue-concurrency
Jun 26, 2026
Merged

perf(selfhost): default QUEUE_CONCURRENCY to 4 so PR bursts drain in parallel#1480
JSONbored merged 1 commit into
mainfrom
claude/queue-concurrency

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Review jobs are I/O-bound (GitHub API + AI awaits dominate), but the queue defaulted to QUEUE_CONCURRENCY=1 — strict serial — so a burst of N PRs took N× the slowest review back-to-back. Default to 4 overlapping job loops.

  • SQLite: WAL + busy_timeout absorb the short serialized write windows; overlapping the I/O waits is the win.
  • Postgres: FOR UPDATE SKIP LOCKED already makes claims race-free across the pool and replicas.
  • QUEUE_CONCURRENCY=1 restores strict serial; documented in .env.example + the self-hosting guide.

Validation

  • npm run typecheck; npm run test:coverage — full suite green, no changed-line coverage gaps (existing concurrency=1/2 tests still pass; nothing asserted the old default).

Roadmap item #3 (throughput).

…parallel

Review jobs are I/O-bound — GitHub API + AI awaits dominate wall time — so the
serial default (QUEUE_CONCURRENCY=1) made a burst of N PRs take N times the slowest
review back to back. Default to 4 overlapping job loops: SQLite's WAL + busy_timeout
absorb the short serialized write windows, and the Postgres queue's FOR UPDATE SKIP
LOCKED keeps claims race-free across the pool/replicas. QUEUE_CONCURRENCY=1 restores
strict serial.
@dosubot dosubot Bot added the size:S label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored
JSONbored merged commit 6543e3c into main Jun 26, 2026
17 checks passed
@JSONbored
JSONbored deleted the claude/queue-concurrency branch June 26, 2026 10:59
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.44%. Comparing base (2ffd657) to head (7388445).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1480   +/-   ##
=======================================
  Coverage   95.44%   95.44%           
=======================================
  Files         194      194           
  Lines       21064    21064           
  Branches     7623     7623           
=======================================
  Hits        20104    20104           
  Misses        383      383           
  Partials      577      577           
Files with missing lines Coverage Δ
src/selfhost/sqlite-queue.ts 97.14% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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