Capacity model
Two questions, answered with arithmetic that make load-test and make estimate can check: how much traffic the services take, and how long the
worker needs for a given set of repositories.
The services
The service limits that bound throughput are in code (file paths at the end):
| Limit | Value | Where it bites |
|---|---|---|
| In flight per API service | DB_MAX_CONNS x 4, 2 s wait, then 503 SERVICE_BUSY | insights and runs under many concurrent calls |
Per address on /api | 100/min (300/min for a forwarded address) | one dashboard user, or a proxy without a trusted-proxy setting |
Per account on /api | 300/min | the dashboard's polling of several pages |
Per agent on /v1 | 600/min | one worker sending many small batches |
Per account on /v1 | 1,200/min | several workers of one account at once |
Batches on /v1 | 500 logs or results per call, 2 MiB | a run with thousands of repositories sends many calls |
| Live streams | 10 per account, 500 per process, 5 min each | many dashboard tabs |
| Manual runs | 10 per hour (paid plan; none without one) | the dashboard's "run now" |
| MCP tool calls | 120/min per account | an agent in a loop |
| Observatory LLM calls | 8 per process, 2 turns per account, 4 tools per message | chat under many users |
| Postgres roles | statement timeout 2 min, lock timeout 30 s | a slow query fails instead of piling up |
What one run of a linked worker costs the control plane: about 12 calls on
/v1 (start, logs in batches, results in batches, progress, complete) and
about 16 inserts (the run, its results, logs, the analytics snapshot, the
outbox event). At the per-account limit of 1,200 calls/min one account can
report at most 100 runs per minute; the insights read path, not the runs
intake, saturates first on a 2-OCPU machine.
Traffic for a population, with the daily schedule the server assigns:
runs per second = accounts x runs per account per day / 86,400
calls per second = runs per second x 12
inserts per second = runs per second x 16
dashboard reads = active users x pages per visit x 9 calls per page / 3,600 per hour
| Accounts | Runs/day each | Runs/s | /v1 calls/s | Inserts/s |
|---|---|---|---|---|
| 1,000 | 1 | 0.012 | 0.14 | 0.19 |
| 100,000 | 1 | 1.2 | 14 | 19 |
| 1,000,000 | 1 | 12 | 139 | 185 |
| 10,000,000 | 1 | 116 | 1,389 | 1,852 |
These are averages; the schedule's slots spread runs over the week, so the
peak is the slot with the most accounts, not a Monday-midnight spike. The
load test's agents scenario measures the calls/s one deployment answers
with the latency the thresholds allow; divide to get the accounts one
deployment serves. The counters of the rate limits move from in-process to
Postgres or Valkey (RATELIMIT_BACKEND) when the services run as several
replicas; Postgres counters are fine to about 2,000 limited calls/s.
The worker: how long a run takes
The worker's run has five phases (engine.RunPhases): list, load the
state, plan, back up, record. scripts/estimate-backup-time.py adds them
up for a given set of repositories; make estimate ARGS="..." runs it.
T_run = T_list + T_state + T_plan + T_backup + T_record
T_list = t_auth + ceil(N / 100) x t_page one page of 100 per GitHub call
T_state = t_load + N x t_row
T_plan = N x t_stat / 8 Stat of every stored archive, 8 at a time
+ B_unchanged / r_read with BACKUP_VERIFY_CONTENT: every unchanged archive read in full
T_backup = max(T_clone+pack, T_upload) clones and packs in parallel, one uploader
T_clone+pack = M x t_clone / min(c, M) + B_changed / bw_down + B_changed / r_pack / min(c, M)
T_upload = B_changed / bw_up + M x t_put (+ ceil(M / 10) x t_push for the git sink)
T_record = t_rec + M x t_result
with N repositories, B the archive bytes, M the repositories that changed
(a cold run: all of them; a warm run: change_rate x N, the largest first
for a pessimistic estimate), c BACKUP_CONCURRENCY (default 5, at most
32), bw_down the link to GitHub and bw_up the link to the sink.
Defaults (the model's Params): 0.5 s per listing page and 1 s to
authenticate; 1 ms per Stat on local disk and 30 ms on S3; 700 MiB/s to
read archives back from local disk; 1.5 s fixed cost per clone; 80 MiB/s to
pack; 0.15 s per S3 put, 2 s per git push of 10 archives; 20 ms to record a
result. They come from the 2026 pilot (175 repositories, 753 MiB of
archives) and from the engine's constants; the telemetry of a real worker
replaces them (below).
What the model says, with the pilot's sizes (a mean archive of 4.6 MiB) and a 100 Mbit/s link, local sink:
| Repositories | Run | Changed | Estimated time | Dominant term |
|---|---|---|---|---|
| 175 | warm (1.7%/day) | 3 | 8 s | listing and three clones |
| 175 | cold | 175 | 2.2 min | 175 fixed clone costs at 5 workers, 805 MiB on the link |
| 175 | cold, 10 Mbit/s | 175 | 12.3 min | the link |
| 1,000 | warm, s3 sink, mixed sizes (60% of 0.5 MiB, 30% of 5, 8% of 50, 2% of 400) | 20 | 64 min | BACKUP_VERIFY_CONTENT downloading 5.7 GiB of unchanged archives from S3 |
| 10,000 | warm, s3, mixed sizes, 16 workers, 500/100 Mbit/s | 200 | 2.2 h | the same download, 57 GiB |
The last two rows are the lesson of the model: with the S3 sink, content
verification costs the whole bucket in download per run. Turn it off for
large S3 sinks (BACKUP_VERIFY_CONTENT=false) and rely on the size and
checksum check, or keep the sink local where reading back is free.
Other caps the estimate warns about:
- A repository that needs more than the 20-minute git timeout to clone on
the measured link fails every run (
GIT_TIMEOUT_S). - The git sink refuses archives above 100 MiB (
too_large). - GitHub's REST limit: an installation token has 5,000 calls/h, plus 50
per repository above 20, capped at 12,500; a personal token has 5,000. A
run spends about 12 calls on
/v1of the control plane (not GitHub) and one GitHub call per 100 repositories listed, plus onegit ls-remoteper 10 repositories when the account shares research telemetry. The estimate prints how many such runs an hour allows.
Calibrating from a worker's own telemetry
Every result the worker records carries clone_ms, pack_ms, upload_ms
and cloned_bytes (migration 000016); export them and pass the file:
\copy (SELECT repository, status, clone_ms, pack_ms, upload_ms, cloned_bytes, archive_size
FROM runs.backup_results WHERE run_id = <id>) TO 'results.csv' CSV HEADER
make estimate ARGS="--repos 175 --telemetry results.csv --cold"
The fixed clone cost becomes the median clone time of the smallest quarter
of the repositories; the link, the packing rate and the upload rate become
the median bytes per second of the largest quarter. The per-run phases are
in runs.backup_runs.telemetry (phases_ms), which checks T_list,
T_plan and T_backup directly against a measured run.
Where the numbers come from
| Fact | Source |
|---|---|
| API limits and in-flight limit | src/backend/github-backup-api/config/config.go, routes/app.routes.go, middleware/concurrency.middleware.go |
| Manual run limits | src/platform/runstore/limits.go |
| MCP limits | src/backend/github-backup-mcp/config/config.go, server/server.go |
| Observatory limits | src/services/github-backup-observatory/config/settings.py |
| Worker constants | src/services/github-backup-worker/config/data.config.go, engine/plan.go, engine/pipeline.go, sink/git.go, sink/s3.go |
| GitHub listing | src/platform/githubapi/githubapi.go |
| Telemetry columns | src/platform/dbmigrate/migrations/000016_run_telemetry.up.sql, src/platform/runstore/runs.go |
| Pilot figures | The October 2026 architecture review (section 4) and its first addendum, now only in git history |
| GitHub REST limits | docs.github.com: rate limits for the REST API |