-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider periodically using VACUUM to reduce memory footprint #530
Comments
The database I mentioned had been running for several years, most probably performing a number of INSERTs and DELETEs over the course of time, which presumably slowly increased database fragmentation more and more. That means that running VACUUM regularly is advisable, especially for workloads with a lot of data updates. I also tried to run |
Haven't looked into it yet, but weren't there issues with running |
I'm just wondering how it would work in dqlite's case |
Yeah, I looked into using VACUUM to reset/empty a database in #435 and concluded that a prerequisite was proper support for attaching additional databases to a dqlite-managed connection, see #435 (comment). But I could certainly be missing something. |
I can think of several design options. But in my mind it's most probably something that's needed for long-running deployments. |
yes agree that it should be scheduled regularly when e.g. |
If you are looking for something cheap, this could initially be implemented "offline", e.g. when the process restarts. |
VACUUM needs to be coordinated using a Raft log entry, since it affects page numbers in the future. |
Sounds like a good point, thanks. |
I've experimented using
VACUUM
against a real-world medium-size Incus/LXD database (~700 containers) that had a size of 41 Megabytes. After running theVACUUM
command, the size of the database was down to 3 Megabytes.Depending on the workflow, if there are large databases that create issues with memory/snapshotting, this might be a relatively cheap and effective measure to explore. It might not have such a dramatic effect in all cases though.
The text was updated successfully, but these errors were encountered: