broker: multiple members for gzip compression#455
Open
williamhbaker wants to merge 1 commit intomasterfrom
Open
broker: multiple members for gzip compression#455williamhbaker wants to merge 1 commit intomasterfrom
williamhbaker wants to merge 1 commit intomasterfrom
Conversation
2c6ffe7 to
b932228
Compare
6754c4f to
019b816
Compare
Each active gzip writer introduces a small but significant amount of memory overhead, on the order of several hundred KB. When there are many active journals being written, this can add up to a large amount of memory usage. This adds a threshold where incremental compression will occur only if there is at least 1 MB of data to compress, and creates a new gzip writing mechanism that allows closing & creating new gzip members, concatenated into the same output file. The spool logic uses this mechanism to create a new gzip member for every batch of incremental compression, eliminating the need to hold a gzip writer in memory for the entire lifetime of the fragment file. This change only applies to standard gzip compression with client-side decompression. If decompression offloading is used, gzip files will continue to be written in a single stream, as there are issues with some object stores truncating multi-member gzip content after the first member.
019b816 to
e956fa9
Compare
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.
Each active gzip writer introduces a small but significant amount of memory overhead, on the order of several hundred KB. When there are many active journals being written, this can add up to a large amount of memory usage.
This adds a threshold where incremental compression will occur only if there is at least 1 MB of data to compress, and creates a new gzip writing mechanism that allows closing & creating new gzip members, concatenated into the same output file. The spool logic uses this mechanism to create a new gzip member for every batch of incremental compression, eliminating the need to hold a gzip writer in memory for the entire lifetime of the fragment file.
This change only applies to standard gzip compression with client-side decompression. If decompression offloading is used, gzip files will continue to be written in a single stream, as there are issues with some object stores truncating multi-member gzip content after the first member.
Manual Testing:
flatememory overhead.