Skip to content

Halve the GitHub refresh rate to fit the rate budget - #14

Merged
tschm merged 1 commit into
mainfrom
fix/github-interval-rate-budget
Aug 30, 2026
Merged

Halve the GitHub refresh rate to fit the rate budget#14
tschm merged 1 commit into
mainfrom
fix/github-interval-rate-budget

Conversation

@tschm

@tschm tschm commented Aug 30, 2026

Copy link
Copy Markdown
Member

Raises JQ_GITHUB_INTERVAL from 300s to 600s, in .env.example and both compose defaults.

Why

The GitHub half makes ~1 call per repo plus 1 per workflow, with no conditional requests, so cost scales linearly with fleet size and doesn't drop when nothing has changed.

Measured on the current 25-repo fleet: ~450–490 calls per pass, 37s wall clock.

Interval Passes/hour Calls/hour vs 5000 ceiling
300s (old) 12 ~5,400–5,900 over budget
600s (new) 6 ~2,700 ~55%

Over budget means the board silently stops refreshing partway through each hour — and a stale board looks exactly like a board where nothing is happening. The failure mode is indistinguishable from the healthy one, which is the worst property a monitoring board can have.

The trade is up to 10 minutes of staleness instead of 5. For quantities measured in open PRs, CI status and template drift, that is not a meaningful loss.

Caveat for existing deployments

The compose defaults only apply where .env leaves the variable unset. A server with an explicit JQ_GITHUB_INTERVAL=300 keeps it and needs the line changed by hand:

grep -n '^JQ_GITHUB_INTERVAL=' .env

Follow-up

The real fix is conditional requests — GitHub does not charge 304s against the limit, so ETags would make an unchanged fleet nearly free and let the interval come back down. This change buys headroom; it does not remove the linear scaling.

Testing

Applied locally and confirmed the collector reports JQ_GITHUB_INTERVAL=600. The 600 figure comes from one measured refresh, not a sustained hour — jq_github_rate_limit_remaining will confirm or correct it.

🤖 Generated with Claude Code

The GitHub half makes roughly one call per repo plus one per workflow, with
no conditional requests, so the cost of a pass scales linearly with the fleet
and does not fall when nothing has changed. A pass over the 25-repo fleet now
measures ~450-490 calls and takes 37s.

At the old 300s that is twelve passes an hour, or ~5400-5900 calls against
GitHub's ceiling of 5000. The budget runs out mid-hour, and a board that
stops refreshing looks identical to a board where nothing is happening -
the failure is silent and it lands exactly when someone is watching.

600s halves it to ~2700/hour, leaving headroom for the fleet to grow. The
cost is up to ten minutes of staleness rather than five, which is the right
trade for a board measured in open PRs and template drift.

The compose defaults move too, so a fresh clone is not born over budget.
Note they only apply where .env leaves the variable unset; an existing
deployment pins it explicitly and needs the line changed by hand.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tschm
tschm merged commit 1004b02 into main Aug 30, 2026
4 checks passed
@tschm
tschm deleted the fix/github-interval-rate-budget branch August 30, 2026 10:06
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