Hive Hive
Sign in

perf(kura): optimize artifact serving read paths

GitHub issue · Closed

Metadata
Source
tuist/tuist #10919
Updated
Jun 24, 2026
Domains
Kura
Details

Summary

  • Speed up Kura’s hot read paths by serving from manifests optimistically, increasing HTTP and REAPI stream chunk sizes, and adding direct fast paths for Xcode keyvalue and REAPI action-cache reads.
  • Fix the Xcode keyvalue metadata mismatch by reading cas_id from the request body when the client does not duplicate it in the query string.
  • Tighten the bounded-resources story by deriving the shared REAPI materialization pool from soft-to-hard memory headroom, capping per-request materialization against that shared pool, and widening pressure shedding to more caches.
  • Add low-memory end-to-end coverage that runs the public API under concurrent traffic with container memory limits, verifies the nodes stay up without OOM kills or restarts, and explicitly unsets the suite-level env overrides in teardown so the memory-pressure profile does not bleed into other specs.

Benchmarks

These numbers were collected on May 21, 2026 from this machine against the live endpoints before deploying this branch. They are the baseline that motivated the hot-path work in this PR, not a post-deploy rerun.

Endpoint /up p50 keyvalue GET p50 CAS GET p50 CAS MiB/s
tuist.kura 81.8 ms 141.1 ms 772.7 ms 10.35
cache-eu-central 71.7 ms 72.2 ms 797.4 ms 10.03
cache-eu-north 129.8 ms 128.0 ms 993.2 ms 8.05
cache-sa-west 813.0 ms 743.8 ms 1735.2 ms 404 anomaly
cache-us-east-2 383.0 ms 409.3 ms 2125.4 ms 3.76
cache-us-east 379.2 ms 387.9 ms 2249.8 ms 3.56
cache-ap-southeast 540.4 ms 542.6 ms 3082.3 ms 2.60
cache-us-west 662.3 ms 584.2 ms 3548.0 ms 2.25
cache-us-east-3 393.5 ms 370.7 ms 6297.6 ms 1.27
cache-au-east 876.2 ms 941.3 ms 8813.0 ms 0.91

The important result from the baseline was that Kura was already slightly ahead on CAS throughput versus cache-eu-central, but it was materially behind on the Xcode keyvalue lookup path. Most of the read-path changes in this PR are targeted at removing that gap without weakening reconciliation, replication, or resource bounds.

Testing

  • mise exec -- cargo test
  • mise exec -- cargo clippy --all-targets -- -D warnings
  • COMPOSE_BAKE=false mise exec -- shellspec spec/e2e/memory_pressure_spec.sh
  • COMPOSE_BAKE=false docker compose build
  • KURA_E2E_SKIP_BUILD=1 COMPOSE_BAKE=false mise exec -- shellspec (16 examples, 0 failures; ShellSpec then exited nonzero because of the existing reporter: 1 issue after completion)
Comments
TA
tuist-atlas[bot] Jun 3, 2026

The performance optimization for artifact serving read paths is now available in kura@0.6.0. Update to get these improvements.