You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to PR #183 (granule-level read concurrency, Closes #180 / #179), filed at espg's direction. Two items were deliberately left out of that PR; this issue captures them so they don't live only in the PR's "Questions for review". Both are gated on the fleet A/B at K∈{1,2,4,6} (issue #180 phase 3, espg-side): the per-invocation cpu_seconds telemetry that PR #183 adds is what produces the utilization data these decisions key on.
1. Dispatcher-side shard-aware K (per-shard granule_workers override)
PR #183 ships data_source.granule_workers as a config-level knob only: one K for the whole run. The spec (issue #180 phase 2) sketched the finer version:
Shard-aware K (free 80% of "shardmap-scoped workers"): the dispatcher can thread a per-shard granule_workers override into the cell event from the shardmap's granule counts — precedent: the aoi_payload per-cell extra in runner.py's _cell_work.
The worker side already accepts event-injected values (the plumbing seam exists in PR #183); nothing sets it yet. The point: shardmaps record granule counts per shard, so the dispatcher can clamp K to min(K_config, n_granules) — a 5-granule shard shouldn't spin up K=6 threads — and could go further (scale K down on the densest shards where RSS headroom at 2 GB is the binding constraint, per issue #117).
Scope sketch:runner.py_cell_work threads granule_workers into the cell event alongside aoi_payload; simplest policy first (min(K, n_granules)), anything cleverer only if the A/B shows shard heterogeneity matters. Tests: dispatcher unit test on the event payload; worker already validates event values.
Gate: worth doing at all only if the A/B lands on a default K > 1.
Utilization approaches the vCPU count (CPU-bound decode/aggregation) → the real design discussion: 2/4/7 GB function variants + dispatch routing by granule count (which composes with item 1 — the same shardmap granule counts drive both the K override and the size routing).
Gate: hard-gated on the A/B utilization data crossing the hammer-the-CPUs bar; do not start this on speculation. Touches deployment/aws/template.yaml (new function resources) — per repo convention that work needs an issue naming it, which this issue does, but the CloudFormation/deploy execution stays espg-side.
Related but distinct: the process-global chunk-fetch budget is upstream h5coro-hidefix work (spec parked on the PR thread: Granule-level read concurrency (K in flight, ordered fold) #183 (comment)) — if it lands, K×read_workers products stop being a connection-pool concern and only the RSS/CPU axes above remain.
(Left unlabeled for espg to triage — add plan/implement when the A/B data is in.)
🤖 from Claude
Follow-up to PR #183 (granule-level read concurrency, Closes #180 / #179), filed at espg's direction. Two items were deliberately left out of that PR; this issue captures them so they don't live only in the PR's "Questions for review". Both are gated on the fleet A/B at K∈{1,2,4,6} (issue #180 phase 3, espg-side): the per-invocation
cpu_secondstelemetry that PR #183 adds is what produces the utilization data these decisions key on.1. Dispatcher-side shard-aware K (per-shard
granule_workersoverride)PR #183 ships
data_source.granule_workersas a config-level knob only: one K for the whole run. The spec (issue #180 phase 2) sketched the finer version:The worker side already accepts event-injected values (the plumbing seam exists in PR #183); nothing sets it yet. The point: shardmaps record granule counts per shard, so the dispatcher can clamp K to
min(K_config, n_granules)— a 5-granule shard shouldn't spin up K=6 threads — and could go further (scale K down on the densest shards where RSS headroom at 2 GB is the binding constraint, per issue #117).Scope sketch:
runner.py_cell_workthreadsgranule_workersinto the cell event alongsideaoi_payload; simplest policy first (min(K, n_granules)), anything cleverer only if the A/B shows shard heterogeneity matters. Tests: dispatcher unit test on the event payload; worker already validates event values.Gate: worth doing at all only if the A/B lands on a default K > 1.
2. Function-size variants (different-size Lambdas) — separate, harder-gated decision
From issue #180's follow-on section, espg's criterion verbatim:
Decision tree from the A/B's
cpu_seconds/wall/RSS data:Gate: hard-gated on the A/B utilization data crossing the hammer-the-CPUs bar; do not start this on speculation. Touches
deployment/aws/template.yaml(new function resources) — per repo convention that work needs an issue naming it, which this issue does, but the CloudFormation/deploy execution stays espg-side.Refs
read_workersproducts stop being a connection-pool concern and only the RSS/CPU axes above remain.(Left unlabeled for espg to triage — add
plan/implementwhen the A/B data is in.)