Arka v1.0 Scale, Benchmarks & Tuning Guide
The default build version in the Makefile is 1.0.0. This guide covers benchmarks and tuning for 1,000+ repositories, concurrent CI/CD pipelines, and RustFS / S3 object storage.
1. Historical 1 KiB Benchmark Snapshot
The historical run used scripts/bench.sh on an Apple M3 Max with PostgreSQL 16.14 and RustFS 1.0.4. Its source commit was unrecorded, so use the figures as historical context. The test and benchmark definitions are in the scale suite.
1,000-Repository Control-Plane & Routing Scale
| Operation (1,000 Repositories in PostgreSQL 16) | Measured Latency |
|---|---|
GetRepositoryByName (indexed lookup) | 0.214 ms |
OverviewStats (cluster-wide aggregation) | 1.602 ms |
ListRepositories (platform admin, 1,000 rows) | 60.570 ms |
ListRepositories (member with scoped RBAC evaluation, 1,000 rows) | 232.759 ms |
Concurrent Data-Plane & RBAC Throughput (16 Concurrent Workers)
| Workload | Total Operations | Throughput (ops/s) | p50 | p95 | p99 |
|---|---|---|---|---|---|
128-Repository Concurrent PUT + GET (1 KiB objects) | 128 | 607.05 | 23.58 ms | 45.47 ms | 47.44 ms |
Sustained Protocol Throughput (PUT + GET per op) | 1,335 | 652.3 | 23.61 ms | 29.23 ms | 51.51 ms |
| Prefix / Coordinate-Scoped RBAC Authorization | 77,685 | 33,042 | 0.439 ms | 0.689 ms | 1.732 ms |
2. Reproduce and Record a Run
Use disposable benchmark infrastructure. Save the exact command and JSON alongside the release record. Record the PostgreSQL server version, the storage driver and implementation/version, and any resource limits or database-pool overrides. Capture results from a clean checkout.
HTTP reports separate runner and server. The runner.git_commit, runner.dirty, runner.go_version, and runner.os/arch fields describe the benchmark checkout and process. The server.server_version field comes from the target health response. Pass --server-commit with the full SHA from the deployed artifact's build record. Unavailable server version or commit fields read unknown. For a release archive, provide --server-commit or save the deployed server image digest alongside the JSON. Record the target toolchain and platform separately when they differ from the runner.
Local 1 KiB baseline
From the repository root, start PostgreSQL and RustFS and capture JSON. Set ARKA_E2E_DATABASE_URL and ARKA_TEST_S3_ENDPOINT when using isolated instances on other ports.
make db-up
ARKA_BENCH_STORAGE_BACKEND=RustFS-1.0.4 ARKA_BENCH_TIME=2s \
./scripts/bench.sh --json > /tmp/arka-scale.jsonThe default output includes the existing Markdown tables and a structured metadata summary. JSON additionally records actual operation counts, concurrency, payload bytes, repository count and Go benchmark time. Each protocol operation in the baseline is one PUT followed by one GET. The baseline builds its in-process Arka fixture with the Makefile's version linker flags and obtains the PostgreSQL version from the fixture connection. The fixture always uses the S3 driver. Set ARKA_BENCH_STORAGE_BACKEND to identify the actual S3-compatible implementation and version.
Small-object publishing during same-repository large uploads
Create a disposable, hosted Raw repository. Set ARKA_TOKEN in the environment to a bearer token with write access. Set ARKA_PERF_DATABASE_URL to the deployment's PostgreSQL connection string so the runner can query SHOW server_version, or pass --postgres-version from the database's build record. Both HTTP workloads require --storage to identify the storage backend backing the measured repository. Set ARKA_SERVER_SHA in these examples to the deployed server's source commit.
./scripts/bench.sh mixed-upload --url http://127.0.0.1:8080 \
--repo perf-raw --storage s3/RustFS-1.0.4 --server-commit "$ARKA_SERVER_SHA" \
--large-mib 64 --large-workers 2 \
--small-bytes 1024 --workers 4 --requests 1000 > /tmp/arka-mixed-upload.jsonLarge PUTs repeat until the small phase ends. In-flight large requests finish before the runner exits. Each PUT uses a unique path and streams a distinct payload, so it exercises blob writes without allocating the full object in the runner. The report includes the number of successful requests in each phase, throughput and p50/p95/p99. The JSON field overlap_method records the sample rule. A large PUT waits for 100 Continue for at most one second or one quarter of the request timeout, whichever is shorter, before sending its body. Its overlap window starts once the transport has written the request headers and begun reading body bytes for transmission. The first response byte stops the window immediately. A parsed informational response resumes it. Go exposes the first-byte hook once, so if an informational response arrives first, the transport stops the window as soon as it returns the final headers. Request failure also closes the window. Each included small PUT must fit entirely within a continuous large-upload window. This measures the runner's HTTP connection. If an ingress acknowledges the body before forwarding it, use a direct endpoint or a streaming ingress to measure contention at Arka. Small-upload throughput divides those overlapping samples by the full small-phase duration. Compare samples with requests to see coverage. Increase the large object size or concurrency when the overlap sample count is too low. Generated assets remain under the reported object_prefix. Remove the disposable repository or clean up that prefix afterward. Use one setup for repeated comparisons because the legacy baseline uses multiple repositories and measures PUT + GET together.
Hot index GET and conditional GET
Use a populated, stable index that serves ETag and honors If-None-Match. This example uses the Packages index in a hosted APT repository. Use an ARKA_TOKEN with read access when the repository requires authentication.
./scripts/bench.sh hot-index --url http://127.0.0.1:8080 \
--index-path /repository/perf-apt/dists/stable/main/binary-amd64/Packages.gz \
--storage s3/RustFS-1.0.4 --server-commit "$ARKA_SERVER_SHA" \
--workers 16 --requests 1000 > /tmp/arka-hot-index.jsonThe runner does one unmeasured GET to prime the index and capture its ETag. It then measures full-body 200 reads and matching If-None-Match requests returning 304 in two phases. Each phase reports its own count, throughput and p50/p95/p99. A changed ETag or unexpected status fails the run. Tail percentiles from short smoke runs depend heavily on the slowest samples. Use repeated runs with enough samples before interpreting them.
The HTTP runner accepts up to 1,000,000 requests per phase and 1,024 foreground workers. Mixed uploads accept up to 128 large-upload workers, 1 MiB small objects, and 16 GiB large objects. The per-request timeout is capped at one hour.
For PostgreSQL queries, search and the management repository list on the seeded million-asset fixture, see the A/B suite. Its suite_hash identifies the measured workloads, including the SQL templates and their control renderer, the measurement commands and sampling logic, and the Go metadata scenarios. Report formatting and provenance fields can change independently. The comparison recognizes the original Baseline A hash for this unchanged workload. Fixture, configuration, and environment checks still apply.
3. Production Tuning Guide
A. RustFS / S3 302 Presigned Download Offloading (Multi-TB Scale)
For large binary artifacts (OCI image layers, .safetensors AI weights, Maven JARs, RPM/DEB packages), enable direct RustFS/S3 offloading so Arka pods only handle authentication, fail-closed RBAC, audit logging, and 302 Found redirection:
ARKA_STORAGE_DRIVER=s3
ARKA_STORAGE_PRESIGN_REDIRECT=true
ARKA_STORAGE_PRESIGN_TTL=5m
ARKA_STORAGE_PRESIGN_MIN_BYTES=1048576 # Offload objects >= 1 MiB; serve tiny metadata inline
ARKA_S3_PUBLIC_ENDPOINT=https://blobs.registry.example.comNote: Repositories with Download Quarantine (
quarantineEnabled: true) automatically disable 302 presigned redirects and stream through Arka'sDownloadGuardso policy changes take effect immediately.
B. Smart Proxy Cache Split TTLs
For high-traffic proxy repositories (Maven Central, npmjs, PyPI, HuggingFace Hub, Docker Hub):
cacheTtlSeconds: Set high (86400–604800, 1–7 days) for immutable versioned releases and commit-pinned HuggingFace weights.metadataCacheTtlSeconds: Set short (60–300) so mutable indexes (maven-metadata.xml, npm packuments, PyPI simple HTML, Helmindex.yaml, branch refs) revalidate via conditionalIf-None-Match(304 Not Modified) with minimal upstream bandwidth.negativeCacheTtlSeconds: Set30–120to shield upstream registries from repeated404probes in large Group repositories.
C. PostgreSQL 16 Tuning (1,000+ Repositories)
Arka uses one shared query pool per replica, bounded by pool_max_conns in ARKA_DATABASE_URL. Each replica also opens one dedicated PostgreSQL connection outside the pool to listen to both arka_jobs and arka_invalidation. See the notification listener.
peak_replicas = HPA maxReplicas + concurrent rollout/replacement replicas
arka_peak = peak_replicas × (pool_max_conns + 1)
max_connections >= arka_peak + migration/maintenance headroom + other clients + PostgreSQL reserved slotsIn-process migrations acquire a connection from the replica's pool. Budget a separately invoked migration process or Job and maintenance sessions in the headroom. Size other-client and PostgreSQL reserved slots from actual cluster settings. Add every deployment sharing that server. Allow for terminating replicas while they still hold database sessions. Use direct database connections or PgBouncer session pooling to preserve Arka's session-level LISTEN and pg_advisory_lock.
The example assigns 20 sessions for separate migration and maintenance, three PostgreSQL reserved slots and zero other clients. The manifests allow one rollout surge replica.
| Operating case | Concurrent replicas | pool_max_conns | Arka sessions | Minimum with example reserves | Example max_connections |
|---|---|---|---|---|---|
| Three steady replicas | 3 | 20 | 63 | 86 | 100 |
| HPA at six replicas | 6 | 25 | 156 | 179 | 200 |
| HPA at six plus one rollout replica | 7 | 25 | 182 | 205 | 225 |
| HPA plus one rollout replica, budget capped at 200 | 7 | 24 | 175 | 198 | 200 |
- Autovacuum: For high-churn
async_jobsandaudit_eventstables, setautovacuum_vacuum_scale_factor = 0.05and partition or archiveaudit_eventsolder than your retention window. - Indexes: Embedded migrations (
0001–0021) pre-create B-tree, trigram, andtext_pattern_opsindexes for repository prefix scans, scoped grants,FOR UPDATE SKIP LOCKEDjob claiming, vulnerability scans, and SBOM license compliance queries.
D. Kubernetes HPA, Ingress & Multi-Replica Workers
- Stateless Replicas: Run
>= 2replicas in production (deploy/helm/arkaanddeploy/kustomize/overlays/prodconfigurePodDisruptionBudget+HPAscaling3–6replicas). - Large Uploads: Ensure Ingress disables request body limits and buffering (
nginx.ingress.kubernetes.io/proxy-body-size: "0",proxy-request-buffering: "off"— pre-configured in Helm & Kustomize). - Async Job Concurrency: Tune
ARKA_JOB_CONCURRENCY(default2per replica) andARKA_JOB_LEASE_TTL(default2m) based on vulnerability scanner CPU budget (increaseleaseTTLto5m–10mwhen scanning multi-GB artifacts with Trivy/Grype).