fix: download without buffering volumes in RAM #92
Merged
moritz
merged 1 commits from 2026-08-31 17:46:46 +00:00
eCommons/backup-bot-two:fix-download-oom into main
No Reviewers
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
appletalk
arjan
basebuilder
BornDeleuze
Brooke
carla
cas (Cassowary)
codegod100
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
flancian
Frando
iexos
jade (Jade Ambrose)
javielico (Javielico)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
marlon (marlon)
mayel
mirsal
moosemower
moritz
nicksellen (Nick Sellen)
notplants
oxaliq (sorrel)
p4u1
pau
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
PhiNatalie
renovate-bot (Comrade Renovate Bot)
ripclap
rix
rscmbbng
sef (sef)
simon
sixsmith (Sixsmith)
stevensting
tobias
trav (Trav Fryer)
val (val (he/him))
vaznasty
virtualboys
wolcen (Chris Thompson)
wykwit
xynosis
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/backup-bot-two#92
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
backup downloaddumps every volume withsubprocess.run(capture_output=True)and keeps all dumps in memory at the same time before writing/tmp/backup.tar.gz. For apps with large volumes, this exhausts the host's RAM.This PR fixes the download function to fetch each path with
restic restoreinto a temp directory, pack it into a<volume>.tarfile, and compress everything into the final backup.tar.gz. By usingrestic restoreinstead of streamingrestic dump, memory usage stays low and it's also much faster: restore downloads with parallel workers, while dump fetches blobs sequentially. Measured against an S3 repo: restore ~22MiB/s vs dump ~0.8MiB/s.The final archive layout is unchanged. Verified by diffing old vs new output for the same snapshot: names, inner tar listings (permissions, sizes, mtimes) and extracted contents are identical.
I just read the code and it looks good. I haven't tested it yet. I will test it before the next release.