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

Feature request: Use zstandard compression instead of zip for gitea dump? #14290

Closed
symgryph opened this issue Jan 10, 2021 · 8 comments · Fixed by #20493
Closed

Feature request: Use zstandard compression instead of zip for gitea dump? #14290

symgryph opened this issue Jan 10, 2021 · 8 comments · Fixed by #20493
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@symgryph
Copy link

gitea dump is cool, but would be way cooler if we could use zstandard for compression instead of zip.....

@techknowlogick techknowlogick added type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jan 10, 2021
@dsseng
Copy link
Contributor

dsseng commented Apr 1, 2021

I can try myself on this. Found a good CGO-free implementation: https://pkg.go.dev/github.com/klauspost/compress/zstd . Does anyone mind depending on this? Another option is using system archiver on *nix.

@clavinet
Copy link
Contributor

I just made a backup of a large instance and would welcome such a feature.

Zstandard would already be faster, but when using it multithreaded (zstdmt), it could go even faster.
Single-threaded zip/gzip only wastes time these days when we have faster methods readily available.

@tepozoa
Copy link

tepozoa commented Jul 24, 2022

(24 Jul 2022) The package already being used, https://github.com/mholt/archiver/v3, (now) supports Zstd. I had a look to dump.go and I think it might just now be a matter of making sure the import is up to date with the latest stable version and adding the tar.zstd extension to the outputTypeEnum?

https://pkg.go.dev/github.com/mholt/archiver/v3#Zstd

Gusted pushed a commit to Gusted/gitea that referenced this issue Jul 26, 2022
- Add `.tar.zst` as supported output type.
- Resolves go-gitea#14290
zeripath pushed a commit that referenced this issue Jul 27, 2022
- Add `.tar.zst` as supported output type.
- Resolves #14290
@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

is it just me or are the resulting archives twice the size of .zip?

I'm a fan of zstd, I am aware of what it can do but if this Gitea setting is using zstd's default compression level (-3 out of 1-19), that might explain the archive size.

perhaps exposing some knobs in the future could cater to users wishing to tweak at least the compression levels of zstd...

vsysoev pushed a commit to IntegraSDL/gitea that referenced this issue Aug 10, 2022
- Add `.tar.zst` as supported output type.
- Resolves go-gitea#14290
@symgryph
Copy link
Author

symgryph commented Oct 11, 2022 via email

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

You can actually specify the level for z standard to use via a environment variable. Look in the reference manuals. I was able to do this with the tar version via a environment variable. Sincerely Thomas Munn

________________________________ From: wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf @.> Sent: Wednesday, August 10, 2022 7:24:07 AM To: go-gitea/gitea @.> Cc: Thomas @.>; Author @.> Subject: Re: [go-gitea/gitea] Feature request: Use zstandard compression instead of zip for gitea dump? (#14290) is it just me or are the resulting archives twice the size of .zip? I'm a fan of zstd, I am aware of what it can do but if this Gitea setting is using zstd's default compression level (-3 out of 1-19), that might explain the archive size. perhaps exposing some knobs in the future could cater to users wishing to tweak at least the compression levels of zstd... — Reply to this email directly, view it on GitHub<#14290 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABCSE3RUPF4NBHRKIZ225ELVYOGNPANCNFSM4V4DKZAQ. You are receiving this because you authored the thread.Message ID: @.***>

thanks for the reply, did you mean somehow using ZSTD_CLEVEL in the process? could you by any chance provide an example command (e.g. gitea dump -c <config> --type <whattype-you-mentioned-tar>?
I know you can do tar <opts> --zstd or even tar <opts> -I"zstd <zstdopts>", but I don't see how that could be used with gitea directly.

or did you mean that you were able to make gitea create a tar and then zstd-compress it?

apologies, it just wasn't clear to me from your answer. @symgryph

@symgryph
Copy link
Author

symgryph commented Oct 11, 2022 via email

@wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf
Copy link
Contributor

Fish format set -gx ZSTD_CLEVEL 19
run your command. The set command is fish shell specific, as I ain't doin no bash!

Sincerely

Thomas Munn

should be sth like export in bash, or running ENVVAR <command> directly.. will try it out, thanks.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants