re_grpc: request zstd-compressed BatchReadBlobs responses#1371
Open
9999years wants to merge 1 commit into
Open
re_grpc: request zstd-compressed BatchReadBlobs responses#13719999years wants to merge 1 commit into
BatchReadBlobs responses#13719999years wants to merge 1 commit into
Conversation
…22) There are many small `BatchReadBlobs` requests, and they're large enough that compression would help. When the server advertises zstd support in its capabilities, advertise zstd as an acceptable response compressor and decompress any zstd-compressed blobs the server returns. NB: It would be nice if we could only compress blobs above a certain size, but we don't know the size when we make the request. We continue to advertise IDENTITY an acceptable response compressor, so we may need to patch our cache server to choose an appropriate size threshold above which to compress data (Bazel chooses 100 bytes, AIUI). In a moderately sized build with ~81,000 BatchReadBlobs requests, this patch shows significant benefits: - Request latency dropped: - p100: 16,653ms to 3,468ms (4.8x speedup) - p90: 953ms to 593ms - p75: 529ms to 312ms - p50: 235ms to 161ms - p25: 110ms to 96ms - p0: 67ms to 68ms - Cumulative blob size over the network dropped from 5,807MiB to 1,626MiB (3.57x compression ratio) - Blob size distribution over the wire improved: - p100: 3.7M to 741.8K - p90: 188.4K to 58.0K - p75: 103.2K to 33.9K - p50: 12.9K to 3.7K - p25: 32B to 45B (regression) - p0: 15B to 2B (regression)
9999years
commented
Jul 13, 2026
| /// Maximum number of digests per `FindMissingBlobs` RPC. | ||
| find_missing_blobs_batch_size: usize, | ||
| /// Whether to request zstd-compressed `BatchReadBlobs` responses (server supports zstd). | ||
| batch_read_zstd: bool, |
Contributor
Author
There was a problem hiding this comment.
We could have a set of supported compressors here instead, but we'd have to do a slightly more invasive refactoring. Let me know if you'd like me to do that.
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D111767018. (Because this pull request was imported automatically, there will not be any future comments.) |
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.
There are many small
BatchReadBlobsrequests, and they're large enough that compression would help. When the server advertises zstd support in its capabilities, advertise zstd as an acceptable response compressor and decompress any zstd-compressed blobs the server returns.NB: It would be nice if we could only compress blobs above a certain size, but we don't know the size when we make the request. We continue to advertise IDENTITY an acceptable response compressor, so we may need to patch our cache server to choose an appropriate size threshold above which to compress data (Bazel chooses 100 bytes, AIUI).
In a moderately sized build with ~81,000 BatchReadBlobs requests, this patch shows significant benefits: