# What is zstd-best-compression, and can I customize?

**URL:** <https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934>\
**Category:** General Topics\
**Created:** [September 5, 2025, 3:06pm UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934 "2025-09-05T15:06:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Angler](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Angler](https://kopia.discourse.group/u/Angler)\
**Post date:** [September 5, 2025, 3:06pm UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/1 "2025-09-05T15:06:29Z")

</div>

I’ve been playing with zstd lately, and find excellent compression using `-22 –ultra –long` and would like to use this with Kopia, if possible.

Storage space is costing me, so I’m looking to compress maximally at the expense of time.

What is the equivalent of zstd-best-compression? I couldn’t find it in the docs. I presume it is `-19` since that’s the highest “non-special” level in zstd by default?

Thanks!

EDIT: On customizing, is there a way to have Kopia use an “external” compression utility, similar to how tar has this?

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [September 7, 2025, 9:36am UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/2 "2025-09-07T09:36:13Z")

</div>

Not that I am aware of. What purpose would that serve? Kopias comrpession options cover all possible ranges, so why try to rely on an external one?

And “best” zstd compression is always subjective. Have you tried to run kopia benchmark on some on your existing data?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [September 7, 2025, 10:44am UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/3 "2025-09-07T10:44:09Z")

</div>

> [@Angler](#):
>
> What is the equivalent of zstd-best-compression? I couldn’t find it in the docs. I presume it is `-19` since that’s the highest “non-special” level in zstd by default?

Kopia uses [https://github.com/klauspost/compress](https://github.com/klauspost/compress) package for zstd compression. And its implementation of different compression levels (inherited by kopia) is as follows:

```
The "Fastest" compression ratio is roughly equivalent to zstd level 1.
The "Default" compression ratio is roughly equivalent to zstd level 3 (default).
The "Better" compression ratio is roughly equivalent to zstd level 7.
The "Best" compression ratio is roughly equivalent to zstd level 11.

```

Changing it would require using different more flexible zstd package and pluging it into kopia. Of course such implemetation would have to be backward compatible. All is open source so if somebody really needs it just have to do it.

---

<div class="post-metadata">

**Author:** ![Angler](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Angler](https://kopia.discourse.group/u/Angler)\
**Post date:** [September 7, 2025, 8:09pm UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/4 "2025-09-07T20:09:11Z")

</div>

I Have run kopia benchmarks on my data.

I ran a test, where I created a single snapshot of a dataset using kopia, then used `tar –use-compress-program ‘zstd -22 –ultra –long=30’` to compare the two. The original data was 466 MB, the kopia repo was 323 MB on disk, and the tar.zst was 159 MB. Pretty big difference, I’d like to use Kopia with the best possible compression I can squeeze out.

EDIT: Included the original data size, for context.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [September 8, 2025, 12:25pm UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/5 "2025-09-08T12:25:04Z")

</div>

> [@Angler](#):
>
> I’d like to use Kopia with the best possible compression I can squeeze out.

The best available today as already mentioned is zstd 11. If you need something better than either compress your data up front or give it a go and suggest PR.

---

<div class="post-metadata">

**Author:** ![budy](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/budy/32/38_2.png) [@budy](https://kopia.discourse.group/u/budy)\
**Post date:** [September 8, 2025, 4:35pm UTC](https://kopia.discourse.group/t/what-is-zstd-best-compression-and-can-i-customize/4934/6 "2025-09-08T16:35:01Z")

</div>

It could also be, that the dedup algorithm, which actually chops your data int chunks, has an effect on the overall compressratio…
