Skip to main content

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):

LimitValueWhere it bites
In flight per API serviceDB_MAX_CONNS x 4, 2 s wait, then 503 SERVICE_BUSYinsights and runs under many concurrent calls
Per address on /api100/min (300/min for a forwarded address)one dashboard user, or a proxy without a trusted-proxy setting
Per account on /api300/minthe dashboard's polling of several pages
Per agent on /v1600/minone worker sending many small batches
Per account on /v11,200/minseveral workers of one account at once
Batches on /v1500 logs or results per call, 2 MiBa run with thousands of repositories sends many calls
Live streams10 per account, 500 per process, 5 min eachmany dashboard tabs
Manual runs10 per hour (paid plan; none without one)the dashboard's "run now"
MCP tool calls120/min per accountan agent in a loop
Observatory LLM calls8 per process, 2 turns per account, 4 tools per messagechat under many users
Postgres rolesstatement timeout 2 min, lock timeout 30 sa 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
AccountsRuns/day eachRuns/s/v1 calls/sInserts/s
1,00010.0120.140.19
100,00011.21419
1,000,000112139185
10,000,00011161,3891,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:

RepositoriesRunChangedEstimated timeDominant term
175warm (1.7%/day)38 slisting and three clones
175cold1752.2 min175 fixed clone costs at 5 workers, 805 MiB on the link
175cold, 10 Mbit/s17512.3 minthe link
1,000warm, s3 sink, mixed sizes (60% of 0.5 MiB, 30% of 5, 8% of 50, 2% of 400)2064 minBACKUP_VERIFY_CONTENT downloading 5.7 GiB of unchanged archives from S3
10,000warm, s3, mixed sizes, 16 workers, 500/100 Mbit/s2002.2 hthe 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 /v1 of the control plane (not GitHub) and one GitHub call per 100 repositories listed, plus one git ls-remote per 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​

FactSource
API limits and in-flight limitsrc/backend/github-backup-api/config/config.go, routes/app.routes.go, middleware/concurrency.middleware.go
Manual run limitssrc/platform/runstore/limits.go
MCP limitssrc/backend/github-backup-mcp/config/config.go, server/server.go
Observatory limitssrc/services/github-backup-observatory/config/settings.py
Worker constantssrc/services/github-backup-worker/config/data.config.go, engine/plan.go, engine/pipeline.go, sink/git.go, sink/s3.go
GitHub listingsrc/platform/githubapi/githubapi.go
Telemetry columnssrc/platform/dbmigrate/migrations/000016_run_telemetry.up.sql, src/platform/runstore/runs.go
Pilot figuresThe October 2026 architecture review (section 4) and its first addendum, now only in git history
GitHub REST limitsdocs.github.com: rate limits for the REST API