Skip to content

task run: instance-type sizing takes 2.5–7 minutes before anything launches #1181

Closed

Description

@scttfrdmn

Measured in experiment E1 (#1171) on spawn v0.135.1, us-east-1, 2026-10-19.

spawn task run ranks the "cheapest of 1325 matching type(s)" before RunInstances. Time from invocation to RunInstances:

Case Time
Auto-sized (cpu: 2), with 4 jobs in flight 149–221 s
Three sized task runs at once 370–419 s
A bare --dry-run 256 s
resources.instance_type pinned 4–5 s

So sizing is most of a host task's wall time: 211 s median auto-sized, against ~53 s pinned. EC2 itself takes about 18 s from RunInstances to the wrapper starting.

Likely cause: sizing fetches prices for every matching type, through truffle's pricing path (Price List) serially or near-serially. See also truffle#182 (Price List throttling).

Options:

  • Cap the candidate set by family or generation before pricing.
  • Price in parallel, with a bound.
  • Cache sizing results per (region, spec resources) on disk for a while.
  • Rank by the spot or on-demand price table (one call) instead of per-type lookups.

Gate: sizing a cpu: 2 spec must make O(1) pricing calls, not O(candidates), checked with a recording fake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions