elb-openapi num_cpus knob and the real core_nt concurrency ceiling¶
Motivation¶
The standing performance goal is "max throughput while preserving NCBI parity,
without changing num_nodes". A prior phase proved the live core_nt ceiling
is 2 concurrent jobs on the 10-node blastpool, bounded by the per-shard
CPU request (6 CPU/shard → floor(15740m / 6000m) = 2 pods/node), and
that NCBI parity is guaranteed independently by the auto-injected full-DB
-searchsp (32,156,241,807,668).
A wrong "page-cache memory wall" model (memory scaling with job count) was corrected: page cache is keyed per shard file and shared across processes, so a node's footprint tracks the number of distinct shards it holds (≤ 10), not the job count. That meant the 2-job ceiling is movable and the real limit is CPU saturation — which had to be measured, not asserted.
User-facing change¶
No user-facing behaviour change. Two code deliverables, both safe:
- Env-gated
ELB_OPENAPI_NUM_CPUSknob (default-OFF) added to the openapi build patch. When set ≥ 1 it writes[cluster] num-cpusinto the generatedelastic-blastconfig; the per-shard CPU request becomesnum-cpus − 2. Unset = currentelastic-blastprofile default (num_cpus=8) = unchanged. - Empirical ceiling measurement recorded in the capacity-gate research doc
(§9.6): with
num_cpus=6the per-shard request drops to4, givingfloor(15740m / 4000m) = 3pods/node and 3 concurrentcore_ntjobs.
The knob is code only — IMAGE_TAGS["elb-openapi"] stays 4.18 and the
shared elb-openapi deployment was restored to 4.18 / MAX_ACTIVE=2 / no
NUM_CPUS immediately after the test.
API / IaC diff summary¶
scripts/dev/patch-openapi-build-context.py(+23): new idempotent_insert_onceblock (markerELB_OPENAPI_NUM_CPUS) placed after thesearchspinjection. Readsos.environ["ELB_OPENAPI_NUM_CPUS"], parses int, and on≥ 1setsconfig["cluster"]["num-cpus"]. Default-OFF.docs/research/aks-capacity-gate.md: §9.5 live-env note corrected (MAX_ACTIVE=2is persisted, not unset); new §9.6 with thenum_cpus=6measurement table.- No Bicep, no
IMAGE_TAGS, no Container App template change.
Validation evidence¶
uv run ruff check scripts/dev/patch-openapi-build-context.py→ All checks passed.- Patched sibling
docker-openapi/app/main.pycompiles (py_compile); both thesearchspandnum-cpusinjections present (grep parity count = 2). az acr build→elb-openapi:test-numcpus(digestsha256:d1f6299b…, 2m54s).- 4-job
core_ntburst (scripts/e2e/concurrency/harness.py --mode burst --n 4): - pod-watcher timeline peak
running_jobs=3,running_pods=30,phases={Running: 30, Pending: 10}— 3 concurrent jobs confirmed. - wall time 145.6 s for 4 jobs (3 done at 126 s, 4th at 145.6 s) ≈ 1.6× faster than the 2-job packing.
- all 4 jobs
succeeded. - Shared service restored: image
4.18,ELB_OPENAPI_MAX_ACTIVE_SUBMISSIONS=2,ELB_OPENAPI_NUM_CPUSabsent, replicas2/2, 0 residual blast pods. Siblingdocker-openapi/left clean (0 dirty). uv run pytest -q api/tests/test_openapi_task.py→ 13 passed.check_frontmatter.py(52 pages) +mkdocs build --strict→ OK.