Repository navigation
docs: what transparent compression costs, measured rather than asserted (#186) - #231
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #186.
Adds
docs/features/compression.md, with the nav entry, a README configuration section, and thedocs/index.mdbullet corrected (it said the guidance page did not exist yet, and pointed at thisissue).
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.
aws s3 cpand boto3 both writethe 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 --compresseddecodes it,aws s3 cpdoes not — sogzip buys back browser readability, not S3-tool readability, which is usually what someone asking
the question actually wants.
29,380× at 16/64/256 MiB.
or not.
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.goasserts bytes.Two of #186's own numbers are wrong
The issue's billing-minimum table was copied from
tiers.goand inherited both of its errors. AWSpublishes no minimum billable object size for
GLACIER,DEEP_ARCHIVE, orINTELLIGENT_TIERING. The archive classes' 40 KB is metadata added per object — 32 KB at thearchive 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 AWSpages as the authority, and names the contradiction with
tiers.goinline.Three defects found by writing it
tiers.gocarries a 40 KB minimum forGLACIER/DEEP_ARCHIVEand 128 KB forINTELLIGENT_TIERING, none of which AWS publishesbackend.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 issueTraceability
#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 wasremoved. 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.TestMkDocsNavMatchesTheTreeis 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