Standardize null pyworker load/perf on 100
Using 1 confused the serverless capacity math. Set workload_calculator, benchmark target throughput, and client cost all to 100 — the conventional default the rest of the system expects. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ async def reserve(
|
|||||||
start = time.monotonic()
|
start = time.monotonic()
|
||||||
log.info("[%s] POST /reserve duration=%ss", label, duration)
|
log.info("[%s] POST /reserve duration=%ss", label, duration)
|
||||||
try:
|
try:
|
||||||
resp = await endpoint.request("/reserve", payload, cost=1)
|
resp = await endpoint.request("/reserve", payload, cost=100)
|
||||||
elapsed = time.monotonic() - start
|
elapsed = time.monotonic() - start
|
||||||
log.info("[%s] returned after %.1fs: %s", label, elapsed, resp.get("response"))
|
log.info("[%s] returned after %.1fs: %s", label, elapsed, resp.get("response"))
|
||||||
return resp["response"]
|
return resp["response"]
|
||||||
|
|||||||
@@ -117,11 +117,11 @@ async def reserve_worker(**params: object) -> dict:
|
|||||||
|
|
||||||
if params.get(BENCHMARK_SENTINEL):
|
if params.get(BENCHMARK_SENTINEL):
|
||||||
# The framework computes max_throughput = workload / time during the
|
# The framework computes max_throughput = workload / time during the
|
||||||
# startup benchmark. A null worker has no throughput concept (a
|
# startup benchmark. A null worker has no real throughput concept,
|
||||||
# reservation is a unitless slot), so we deliberately take ~1s with
|
# so we deliberately take ~1s with workload=100 to pin
|
||||||
# workload=1 to pin max_throughput to ~1.0. Without this the
|
# max_throughput to ~100. Without this the near-instant benchmark
|
||||||
# near-instant benchmark would report hundreds of thousands of
|
# would report hundreds of thousands of workload/sec, distorting
|
||||||
# workload/sec, distorting any downstream capacity math.
|
# any downstream capacity math.
|
||||||
await asyncio.sleep(1.0)
|
await asyncio.sleep(1.0)
|
||||||
return {"ok": True, "benchmark": True}
|
return {"ok": True, "benchmark": True}
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ worker_config = WorkerConfig(
|
|||||||
# it to a free worker (or spins up a new one).
|
# it to a free worker (or spins up a new one).
|
||||||
max_queue_time=0.0,
|
max_queue_time=0.0,
|
||||||
remote_function=reserve_worker,
|
remote_function=reserve_worker,
|
||||||
workload_calculator=lambda _payload: 1.0,
|
workload_calculator=lambda _payload: 100.0,
|
||||||
benchmark_config=BenchmarkConfig(
|
benchmark_config=BenchmarkConfig(
|
||||||
generator=lambda: {BENCHMARK_SENTINEL: True},
|
generator=lambda: {BENCHMARK_SENTINEL: True},
|
||||||
runs=1,
|
runs=1,
|
||||||
|
|||||||
Reference in New Issue
Block a user