borgbackup/docs/usage
Thomas Waldmann 0e3876d5e4
buzhash64: add FastCDC-style normalized chunking
Normalized chunking switches between a stricter and a looser cut mask
around the target chunk size. This greatly tightens the chunk-size
distribution (coefficient of variation ~0.9 -> ~0.3 in tests) and removes
the dedup-hostile max-size-clamped chunks, with unchanged deduplication.

chunker-params for buzhash64 gains a required 6th field, nc_level:

  buzhash64,chunk_min,chunk_max,chunk_mask,window_size,nc_level

Use nc_level=2 for the new default, nc_level=0 to disable (then behavior
is byte-identical to the previous single-mask chunker).

buzhash (32bit) is untouched and stays bit-compatible with borg 1.x.

The mask transition point (normal_size) defaults to a principled formula
(target minus the expected loose-phase tail) so the mean stays near the
target; it can be tuned via the normal_size constructor arg.

scripts/chunker_bench.py: evidence harness used to measure chunk-size
distribution, dedup ratio, throughput and shift-resilience.

Measurements (before = nc_level 0, after = nc_level 2; both at the default
params buzhash64,19,23,21,4095; measured with scripts/chunker_bench.py):

5 GiB of incompressible data (~2000-2700 chunks, statistically stable):

  before:  CV 0.739,  49 max-size-clamped (8 MiB) chunks,   953 MB/s
  after:   CV 0.311,   0 max-size-clamped chunks,          1024 MB/s

Re-backup of a 2.5 GiB file after a few scattered single-byte edits
(deduplication ratio; 0.5 = v2 fully deduplicated against v1, lower is
better):

   64 edits:  before 0.5424  ->  after 0.5235
  320 edits:  before 0.6791  ->  after 0.6142

Normalized chunking deduplicates better after edits: removing the
max-size-clamped chunks means a single-byte change invalidates much less
data (about 36% less dedup overhead at 320 edits). Throughput was also
consistently higher with nc_level=2 at this scale.

Also: fix bug when computing the mask, one needs to use 1ULL instead of
1, so the shifting computation is done in a uint64, not in a 32bit int.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 12:00:09 +02:00
..
general Renames --since to --from 2026-06-20 18:36:59 +02:00
analyze.rst analyze: sum up changed chunks per parent directory 2024-10-02 16:14:44 +02:00
analyze.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
benchmark.rst docs: usage: add benchmark cpu and key change-location 2022-03-26 23:40:03 +01:00
benchmark_cpu.rst.inc Regenerate usage docs from current CLI help source 2026-02-22 11:50:58 +01:00
benchmark_crud.rst.inc Regenerate usage docs from current CLI help source 2026-02-22 11:50:58 +01:00
borgfs.rst [DOCS] #4587 – Make Sphinx warnings break docs build 2020-03-16 19:06:00 +01:00
borgfs.rst.inc Regenerate usage docs from current CLI help source 2026-02-22 11:50:58 +01:00
break-lock.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
check.rst docs: split usage 2017-06-07 00:38:48 +02:00
check.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
common-options.rst.inc remove leftover socket: protocol code 2026-06-10 18:51:55 +02:00
compact.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
compact.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
completion.rst completion: borg can now generate completion scripts for supported shells, fixes #9172 2025-11-17 18:47:00 +01:00
completion.rst.inc completion: borg can now generate completion scripts for supported shells, fixes #9172 2025-11-17 18:47:00 +01:00
create.rst create --paths-from-shell-command, fixes #5968 2026-03-10 20:16:26 +01:00
create.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
debug.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
delete.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
delete.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
diff.rst diff --sort-by: enhanced sorting, fixes #8998 2025-11-03 19:25:02 +01:00
diff.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
export-tar.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
extract.rst extract: document how to use wildcards in PATHs 2025-10-10 11:20:08 +02:00
extract.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
general.rst manual corrections/reverts 2025-09-23 14:56:35 +02:00
help.rst docs: split usage 2017-06-07 00:38:48 +02:00
help.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
import-tar.rst.inc build_usage / build_man 2025-04-21 21:08:42 +02:00
info.rst docs: update about archive series 2024-09-18 14:05:12 +02:00
info.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
key.rst Merge pull request #9769 from ThomasWaldmann/docs-key-subcommands 2026-06-13 23:47:58 +02:00
key_add.rst.inc docs: add docs for "key add", "key list" and "key remove" 2026-06-13 21:37:21 +02:00
key_change-location.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
key_change-passphrase.rst.inc build_usage / build_man / doc updates 2022-06-25 21:58:19 +02:00
key_export.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
key_import.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
key_list.rst.inc docs: add docs for "key add", "key list" and "key remove" 2026-06-13 21:37:21 +02:00
key_remove.rst.inc docs: add docs for "key add", "key list" and "key remove" 2026-06-13 21:37:21 +02:00
list.rst list: fix --pattern examples, fixes #7611 2023-06-29 23:04:21 +02:00
list.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
lock.rst docs: split usage 2017-06-07 00:38:48 +02:00
mount.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
mount.rst.inc Regenerate usage docs from current CLI help source 2026-02-22 11:50:58 +01:00
notes.rst misc docs updates 2026-06-16 15:21:57 +02:00
prune.rst Renames --since to --from 2026-06-20 18:36:59 +02:00
prune.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
recreate.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
recreate.rst.inc Regenerate usage docs from current CLI help source 2026-02-22 11:50:58 +01:00
rename.rst cli: rename r* commands to repo-* 2024-09-08 18:06:24 +02:00
rename.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
repo-create.rst docs: update repo-create examples for split --encryption/--id-hash 2026-06-16 14:28:03 +02:00
repo-create.rst.inc repo-create: split --encryption into --encryption + --id-hash, #9168 2026-06-15 17:44:38 +02:00
repo-delete.rst docs: fix usage docs and references for repo-* commands 2024-09-08 18:06:26 +02:00
repo-delete.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
repo-info.rst crypto: drop the NAME attribute; repo-info builds the suite string from ENC_NAME/IDHASH_NAME 2026-06-15 19:38:32 +02:00
repo-info.rst.inc build_usage / build_man 2025-04-21 21:08:42 +02:00
repo-list.rst repo-list: add hostname/username/comment to default format, reorder, adjust 2024-09-26 15:53:36 +02:00
repo-list.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
repo-space.rst docs: fix usage docs and references for repo-* commands 2024-09-08 18:06:26 +02:00
repo-space.rst.inc build_usage build_man 2026-03-15 14:37:50 +01:00
serve.rst misc docs updates 2026-06-16 15:21:57 +02:00
serve.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
tag.rst tag: set, add, remove tags 2024-10-02 23:52:39 +02:00
tag.rst.inc build_usage build_man 2026-03-15 14:37:50 +01:00
tar.rst fixed typos and grammar (AI) 2025-09-23 14:56:23 +02:00
transfer.rst buzhash64: add FastCDC-style normalized chunking 2026-06-28 12:00:09 +02:00
transfer.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
umount.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
undelete.rst build_usage build_man 2024-11-16 20:14:16 +01:00
undelete.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00
usage_general.rst.inc add support for yaml config files, default config 2026-03-10 18:36:30 +01:00
version.rst scripts/gendocs.py: make it work 2024-02-09 17:37:38 +01:00
version.rst.inc build usage / man 2026-06-16 14:17:43 +02:00
with-lock.rst.inc build_usage build_man 2025-12-23 18:00:09 +01:00