git: limit concurrent pack generation across HTTP and SSH #262

closed cmc opened this on 2026-09-28 02:36 UTC · ops security

Discussion

cmc 2026-09-28 02:36 UTC

Nothing limits concurrent git subprocesses.

Smart HTTP upload-pack (internal/httpd/smart.go:122) and SSH transport (internal/gitutil/gitutil.go:39) each start a git process per request with no shared budget; the route middleware adds compression and headers only. A full clone of krz/gitbay costs about 17 seconds of work, so a few anonymous clones at once can saturate bay1's four cores. The Performance page measures single requests.

  • A global and per-principal limit on pack generation across HTTP and SSH, with a bounded queue and cancellation when the client goes away.
  • Cheap reads stay outside the limit.
  • A concurrent-clone benchmark on the Performance page.

referenced in commit 7a6343d02d by cmc: wiki: architecture and security pages

2026-09-28 04:30 UTC

referenced in commit 4e0958a163 by cmc: plans: open issues from the architecture and UX reviews

2026-09-28 05:43 UTC

referenced in commit b711b70da5 by cmc: plans: apply decisions on the open questions

2026-09-28 06:16 UTC

referenced in commit 7d1aad238f by cmc: tests: newer callers pass a nil pack limiter to New

2026-09-28 23:13 UTC

referenced in commit 539835bd23 by cmc: wiki: Known-Gaps keeps the open #298 row

2026-09-28 23:13 UTC

referenced in commit 6ee49bebaa by cmc: hookd: cap refs in a refused-push row; pack-limit docs name the class cap

2026-09-28 23:13 UTC

referenced in commit 9c31ca2462 by cmc: packlimit: log refusals once a minute per transport

2026-09-28 23:13 UTC

referenced in commit 77ff123033 by cmc: wiki: unkeyed audit chain, stall kill, enforced limits, pack-limit gaps

2026-09-28 23:13 UTC

referenced in commit bd49b87fce by cmc: httpd: web archives take a pack slot

2026-09-28 23:13 UTC

referenced in commit 6c6c6248c1 by cmc: packlimit: key IPv6 clients on their /64; anonymous clients leave a slot for accounts

2026-09-28 23:13 UTC

referenced in commit 8b4a553eee by cmc: config: pack_queue = -1 leaves the queue unbounded

2026-09-28 23:13 UTC

closed by cmc in commit 3035725993: gitbayd: one pack-generation limit for SSH, HTTP and git://

2026-09-28 23:13 UTC

referenced in commit b94ae2638b by cmc: httpd, gitd: pack generation takes a slot; ls-refs does not

2026-09-28 23:13 UTC

referenced in commit be2c840ec8 by cmc: sshd: upload-pack and upload-archive take a pack slot; killed when the client leaves

2026-09-28 23:13 UTC

referenced in commit ee55b8c0ca by cmc: config: pack_concurrency, pack_per_principal, pack_queue, pack_queue_wait

2026-09-28 23:13 UTC

referenced in commit 99c5044cba by cmc: packlimit: global and per-principal limit with a bounded queue

2026-09-28 23:13 UTC