Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When copying uncompressed images, compress on them on-the-fly #420

Merged
merged 1 commit into from Apr 30, 2024

Conversation

fmoessbauer
Copy link
Member

@fmoessbauer fmoessbauer commented Apr 30, 2024

When copying an uncompressed image, we lightly compress the image on the fly with zstd on transfer. By that, subsequent zeros (holes) are automatically collapsed and not transferred, which can give a huge speedup on uncompressed images. Another advantage is, that zstandard can be decompressed with a very low overhead (e.g. compared to gz or xz) and is better suited for low-memory devices.

closes: #20

@fmoessbauer
Copy link
Member Author

@chombourger This change is client-only, i.e. no need to update the backend. As I was not able to test the S3 path, please explicitly test this as well.

@jan-kiszka
Copy link
Contributor

Tested here over a low-speed link against a low-speed mtda device, and it works nicely.

@jan-kiszka
Copy link
Contributor

...except that zstandard here (0.13) does not work with closefs=True.

@chombourger
Copy link
Collaborator

I haven't looked at your changes yet but 1st: thank you!
2nd: could you add a Closes: #20 line to your commit?

When copying an uncompressed image, we lightly compress the image on the
fly with zstd on transfer. By that, subsequent zeros (holes) are
automatically collapsed and not transferred, which can give a huge
speedup on uncompressed images. Another advantage is, that zstandard can
be decompressed with a very low overhead (e.g. compared to gz or xz) and
is better suited for low-memory devices.

closes: siemens#20

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
@fmoessbauer
Copy link
Member Author

Together with @jan-kiszka , we checked if the closefs=True is really needed (that was the reason for the zstandard version bump). However, the FD has always been closed (checked versions 0.14+), so we don't need to explicitly set it. By that, no need to update the minimal supported zstandard version.

@chombourger chombourger merged commit 7328ad3 into siemens:master Apr 30, 2024
5 checks passed
@fmoessbauer fmoessbauer deleted the fm/compress-on-the-fly branch April 30, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compress image on-the-fly in storage write
3 participants