TB-level datasets change how backups work: the bottleneck shifts from space to time and bandwidth. This episode optimizes restic with `--read-concurrency`, network buffers, and caching (`--cache-dir`), benchmarks the dedup rate, and designs patterns for many hosts aimed at one server.

So far you have practiced with small datasets. Episode 18 is about scale: when data reaches the TB level, or 50 hosts back up to one server, the rules change. Backup is no longer about "does it work", but "how long and how cheap".
The key is not random tinkering, but understanding where the bottleneck is: CPU, disk, or network — then adjusting the right parameters.
Before tuning, measure the baseline. The dedup rate is the most informative number:
restic stats --mode raw-data
restic stats --mode restore-sizeThe comparison of the two (episode 6) determines the strategy: high-dedup data (containers, logs, code) benefits hugely from chunking; unique data (photos/videos) needs more bandwidth than CPU.
Also measure backup time per data volume:
restic backup /data --json | jq '.total_duration, .data_added_packed'Make these numbers your baseline; every tuning is measured against it, not by feel.
Restore and check --read-data open many blobs at once. --read-concurrency controls the number of parallel reads:
restic restore latest --target /tmp/r --read-concurrency 32s3.connections option (episode 16) is related.For remote backends (S3, rest-server), latency matters more than bandwidth. Every request uses one connection; with small buffers, throughput is limited by round-trips. Common S3 tuning:
restic -o s3.connections=10 \
-o s3.part-size=64 \
-o s3.upload-concurrency=8 \
backup /datas3.connections: number of parallel connections.s3.part-size (MiB): multipart part size — larger parts = fewer requests.s3.upload-concurrency: parallel uploads per file.Check your backend's docs — every backend has its own -o options you can explore with restic help.
Restic keeps a local index and blob cache to avoid re-downloading:
restic --cache-dir /var/cache/restic backup /dataTip
For giant datasets, separate index from data: put the cache on SSD, the data chunks on HDD. Daily backups use the index cache (small, fast), while large blobs flow to the cheap HDD.
Practices for data > 1 TB:
--read-data-subset (episode 11) for incremental verification.restic ls/find before restore to avoid wrong-path selective restores.prune weekly in quiet hours, not after every backup.When many hosts back up to one rest-server/S3, management rules:
$((RANDOM % 60))) in cron.--limit-upload (episode 7) so small hosts don't starve.prune does not lock others.M=$((RANDOM % 60))
echo "$M 2 * * * root /usr/local/bin/backup-restic.sh" > /etc/cron.d/restic-backup--read-concurrency: match the disk type (high on SSD, low on HDD).s3.connections, s3.part-size, s3.upload-concurrency.--cache-dir on SSD separates fast index from large data.--read-data-subset, a separate prune schedule.In the next episode, episode 19, we explore the ecosystem: rest-server, SDK & wrappers — rest-server as a backup-server product, wrappers like resticprofile and restic-compose, Grafana dashboards, Prometheus metrics, and integrating backups into CI/CD pipelines.