On LMDB compaction #1006
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind/experimental
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
admin-sdk
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#1006
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
On one node, we have a 145GB file for ~4GB of useful data.
Here is an overview from
lmdbnav
(a tool by PowerDNS dev):Workaround
mdb_copy with the
-c
flag can do this compacting work, and it indeed reduce the database size:We went from 146GB to 3.9GB (37x smaller)
Compact snapshots
Snapshots are amplifying wasted data here. I think one easy step would be to activate compaction when performing a snapshot.
This is the only line to edit: https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/db/lmdb_adapter.rs#L112
Compact main database
Another would be to trigger this task upon Garage shutdown, as compaction can be done only when Garage is offline, we could have a dedicated command line to do that, which would require more operation work, or doing that upon shutdown or startup. On startup, it's an issue, as we probably want to start Garage as fast as possible, especially when a crash occured. However, clean shutdown are always done when you can afford to loose a node, so it's the perfect time to do some maintenance work.
Could we create compacted snapshots?to On LMDB compaction