Skip to content

docs: what transparent compression costs, measured rather than asserted (#186) - #231

Merged
scttfrdmn merged 1 commit into
mainfrom
docs/186-compression-guidance
Aug 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
docs/186-compression-guidance

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #186.

Adds docs/features/compression.md, with the nav entry, a README configuration section, and the
docs/index.md bullet corrected (it said the guidance page did not exist yet, and pointed at this
issue).

What the page says

The question #186 was filed for: project-level compression saves bandwidth and end-to-end latency —
what else does it buy? Less than you would expect, and it costs four things the configuration key
does not hint at.

  1. A compressed object is not readable by anything but ObjectFS. aws s3 cp and boto3 both write
    the raw zstd frame to disk with a successful exit status; there is no error to notice. gzip is a
    partial exception and only over HTTP — curl --compressed decodes it, aws s3 cp does not — so
    gzip buys back browser readability, not S3-tool readability, which is usually what someone asking
    the question actually wants.
  2. A 4 KiB read of a compressed object transfers the whole stored object: 1,836× / 7,344× /
    29,380× at 16/64/256 MiB.
  3. Enabling compression turns off parallel range reads for the whole bucket, compressed objects
    or not.
  4. On the three tiers with a 128 KB billable floor, compressing 100 KB to 40 KB changes the
    invoice by zero.

Bytes are presented as the result and wall-clock only as an aside, for a reason stated on the page:
bytes are a property of the design, latency is a property of the day. The audit measured this defect
shape at 15.6×/43×/216.5×; this page measures 3.0×/5.0×/12.3×. Same defect, different days, neither
reproducible. The byte counts are, which is why read_amplification_test.go asserts bytes.

Two of #186's own numbers are wrong

The issue's billing-minimum table was copied from tiers.go and inherited both of its errors. AWS
publishes no minimum billable object size for GLACIER, DEEP_ARCHIVE, or
INTELLIGENT_TIERING. The archive classes' 40 KB is metadata added per object — 32 KB at the
archive rate plus 8 KB at Standard — and an addition points the opposite way from a floor:
compression does reduce the archive bill, it just cannot touch the surcharge, which is about 23×
the payload for a 10 KB object on DEEP_ARCHIVE. The page states what AWS publishes, links the AWS
pages as the authority, and names the contradiction with tiers.go inline.

Three defects found by writing it

#228 The parallel-read gate keys on the compression config, so it is closed for objects that were never compressed. It is C4's residue one line above C4's fix — C4 moved bytes that didn't need moving, which a byte-count assertion catches; this merely declines an optimization, so nothing fails and nothing logs
#229 tiers.go carries a 40 KB minimum for GLACIER/DEEP_ARCHIVE and 128 KB for INTELLIGENT_TIERING, none of which AWS publishes
#230 A mount decodes only its configured algorithm. I wrote the opposite into the draft on the strength of backend.go:417-420's comment, which says objects stay readable across a config change; a four-way probe disproved it — an object written with zstd fails under each of gzip, lz4, and none. Correcting that comment is an acceptance criterion on the issue

Traceability

#186 set the constraint: "a page either names bucket, region, and object size, or it says nothing
about throughput"
, which is docs-platform/index.md's standard after its hardcoded chart was
removed. Every figure here is either linked to the AWS page that publishes it or carries its bucket,
region, date, and payload, and the page ends with a section saying which is which. Three of my own
computed figures were wrong in the first draft and were caught by re-deriving them.

Verification

  • go test -race ./internal/config/ — ok, including all four doc gates. TestMkDocsNavMatchesTheTree
    is what requires the nav entry
  • pre-commit run --files docs/features/compression.md mkdocs.yml README.md docs/index.md CHANGELOG.md
    — all Passed, markdownlint Passed, nothing auto-fixed

Closes #186.

The question this page exists to answer: project-level compression saves
bandwidth and end-to-end latency — what else does it buy? Less than you would
expect, and it costs four things the configuration key does not hint at.

1. A compressed object is not readable by anything but ObjectFS. `aws s3 cp`
   and boto3 both write the raw zstd frame to disk with a *successful exit
   status*; there is no error to notice. gzip is a partial exception and only
   over HTTP — `curl --compressed` decodes it, `aws s3 cp` does not — so gzip
   buys back browser readability, not S3-tool readability, which is usually
   what someone asking the question wants.
2. A 4 KiB read of a compressed object transfers the whole stored object:
   1,836× / 7,344× / 29,380× at 16/64/256 MiB.
3. Enabling compression turns off parallel range reads for every object in the
   bucket, compressed or not.
4. On the three tiers with a 128 KB billable floor, compressing 100 KB to
   40 KB changes the invoice by zero.

Bytes are the result and wall-clock only an aside, for a reason stated on the
page: bytes are a property of the design, latency is a property of the day. The
audit measured this defect shape at 15.6×/43×/216.5× and this page measures it
at 3.0×/5.0×/12.3× — same defect, different days, neither reproducible. The
byte counts are, which is why read_amplification_test.go asserts bytes.

Two of the numbers #186 itself specified are wrong, so the page states what AWS
publishes and links the pages that publish it. AWS applies no minimum billable
object size to GLACIER, DEEP_ARCHIVE, or INTELLIGENT_TIERING. The archive
classes' 40 KB is metadata *added* per object (32 KB at the archive rate, 8 KB
at Standard) — an addition points the opposite way from a floor: compression
does reduce the archive bill, it just cannot touch the surcharge, which is
about 23× the payload for a 10 KB object on DEEP_ARCHIVE.

Writing it found three defects, each filed rather than described:

- #228 the parallel-read gate keys on the compression *config*, so it is closed
  for objects that were never compressed. It is C4's residue one line above
  C4's fix — C4 moved bytes that didn't need moving, which a byte-count
  assertion catches; this merely declines an optimization, so nothing fails and
  nothing logs.
- #229 tiers.go carries a 40 KB minimum for GLACIER and DEEP_ARCHIVE and
  128 KB for INTELLIGENT_TIERING, none of which AWS publishes. #186's own table
  was copied from it and inherited both errors.
- #230 a mount decodes only its configured algorithm. I wrote the opposite into
  the draft on the strength of backend.go:417-420's comment, which says objects
  stay readable across a config change; a four-way probe disproved it. An
  object written with zstd fails under each of gzip, lz4, and none. Correcting
  that comment is an acceptance criterion on the issue.

The page ends with how every figure was produced — bucket, region, date,
payload, and which tables are pinned in CI against the in-process substrate
endpoint. That is docs-platform/index.md's standard after its hardcoded chart
was removed: a page either names its parameters or says nothing.
@scttfrdmn
scttfrdmn enabled auto-merge (squash) August 3, 2026 01:11
@scttfrdmn
scttfrdmn merged commit 5b8e97e into main Aug 3, 2026
22 checks passed
@scttfrdmn
scttfrdmn deleted the docs/186-compression-guidance branch September 20, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compression guidance doc: the tradeoffs are not obvious and two of them cost money or readability

1 participant