Repository navigation
Conversation
An idle minute tick read 919 rows at six subscriptions and 19,542 at thirty subscriptions with a webhook endpoint (28 million rows a day against Workers Free's 5 million), and wrote 74 to 111 rows a tick (over the 100,000-a-day write limit). Invoice balances scanned every credit note, allocation and collection, the subscription observer walked every subscription twice a minute, the webhook observer re-evaluated every customer's entitlements every minute, and the dispatcher wrote a row per job per run. - Indexes that match the observers' queries (migration 0131), and a partial index so the collection runner reads only collections that can still act. - The subscription observer sweeps on a new local day, hourly, and at most every five minutes on recorded activity; source writes still record their own state in their transaction. - The webhook observer re-evaluates only customers named by new audit subjects or usage events, and sweeps on a new local day or hourly. - The dispatcher records every run but writes a job row only when the job changed something, failed or ran over two seconds, and trims history older than seven days at most a hundred runs an hour. - One read-budget test through the emitted Worker with a metered D1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Closing because the same quiet minute returns seven completed job records on main and none here through the owner job-runs API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
On Workers Free every tool on an account shares 5,000,000 D1 rows read and 100,000 rows written a day. Nectar's minute cron (audited at origin/main d378911, v0.1.1) read 919 rows a tick at six subscriptions and 19,542 at thirty subscriptions with one webhook endpoint (about 28 million a day), and wrote 74 to 111 rows a tick (about 160,000 a day).
What changed
job-runsdoor behaviour: a quiet minute now lists no jobs.tests/nectar/job-runs.mjsand API.md are updated for that; thrown failures still list the failed job and the unstarted ones after it.Measurements (local D1,
meta.rows_read/rows_written)Same harness before and after: thirty subscriptions, sixty issued invoices, one webhook endpoint, the full minute job list.
The new
cronBudgetFlowruns this through the emitted Worker with a metered D1 (thirty subscriptions, sixty invoices, an endpoint, thirty days of dispatcher history): quiet minute 48 read and 6 written, hourly sweep 2,435 read and 69 written. Ceilings are generous (150 / 20 quiet, 6,000 / 400 sweep, 500k / 30k a day).Tests run locally
cronBudgetFlow, jobRunsFlow (updated), subscriptionStatesFlow, webhooksFlow, webhookLifecycleFlow, entitlementQuotasFlow, entitlementVisibilityFlow, automaticCollectionFlow, lifecycleFlow, dunningSequenceFlow, dunningCustodyFlow, paymentRetriesFlow, testModeFlow, nativeIntervalErasureFlow, plus typecheck,
rer check, deployment-spec check and edition lock.Not released: no version bump.
🤖 Generated with Claude Code