Skip to content

spored bootstrap is 12.5 KB gzipped, 76% of EC2's 16 KiB user-data limit; a task has ~2 KB left #1246

Closed

Description

@scttfrdmn

Measured while fixing #1063 (offline, spawn main at c97d887, using launcher.BuildUserData, the exact bytes Provision sends):

Piece Raw gzip
Bare spored bootstrap (BuildLinuxBootstrap{Username: "ec2-user"}, no task) 38,064 B 12,488 B
Task wrapper, trivial command 3,414 B 1,403 B
Task terminal-flush hook 1,957 B 916 B
Whole user data, trivial spawn task run 14,146 B of 16,384

So the fixed bootstrap uses 76% of EC2's user-data limit before any task content. A trivial task uses 86%. That leaves about 2.2 KB of compressed command plus inputs/outputs. In the #1063 gate fixture, a 2,676-character incompressible (hex) command is the most that fits.

That matches what #1063's reporters saw: specs that launched on 0.128.2 stopped launching on 0.131.1+, and the bootstrap grew 4-5 KB over that range (spored install #940, plugins.json #1045). #1063 (PR pending) now refuses these specs before any AWS call. It does not give back any headroom, and every new bootstrap feature shrinks the budget further.

Options, as #1063's comments suggest:

  1. Fetch the bootstrap body, or the task wrapper, from S3 (already staged per launch, and the spored install already verifies a KMS signature) and keep only a small, verifying stub in user data.
  2. Find what in the 38 KB bootstrap compresses so poorly (3x). Anything embedded and already encoded is a candidate.

A gate worth having: a test that the bare bootstrap's gzip size stays under a budget (for example 8 KiB), so growth is a decision, not an accident.

Activity

  1. added this to the Later milestone on Oct 20, 2026
  2. scttfrdmn commented on Oct 21, 2026

    @scttfrdmn
    ContributorAuthor

    Newer measurement on spawn 0.139.1: spawn task run --dry-run on a spec whose command is just bash -c 'echo hi', with no inputs or outputs, prints User data: 14748 of 16384 bytes after gzip. That leaves about 1.6 KB for a task's own command, down from the ~2 KB noted above.

    Concrete casualty: the cookbook's recipes/psi4 spec, unchanged since it last ran on 0.116.0, is now refused before launch at 17070 bytes after gzip (EC2 allows 16384). We moved its inline Python to staged, sha256-checked files to get it under, at 16291 of 16384. Any spec whose command is more than about 1.5 KB gzipped will hit the same wall.

    A per-task bootstrap fetched from S3, with user-data reduced to a small stub, would remove the ceiling rather than move it.

  3. scttfrdmn commented on Oct 21, 2026

    @scttfrdmn
    ContributorAuthor

    Version window, from another run: a spawn built from the v0.137.0 tag passed spawn's own check, but EC2 then rejected RunInstances with User data is limited to 16384 bytes. A build from v0.131.1 launched the same unmodified specs fine. So the bootstrap crossed the line somewhere between 0.131.1 and 0.137.0, and 0.138+'s pre-launch check reports it correctly. The bare bootstrap for an echo hi task measured 15,363 B on 0.139.1.

  4. scttfrdmn commented on Oct 23, 2026

    @scttfrdmn
    ContributorAuthor

    The user-visible regression this causes (specs that launched on 0.131.1 are refused on 0.137+) is now tracked separately as #1275.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions