Create a function to produce hostd.db backups without the cache #923
NickJH
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
At the moment, creating backups is suboptimal. The "recommended" route with Litestream hammers hostd ingress (and possibly egress) performance. At the same time, it has a colossal space requirement. The newer version, #922, which speeds up taking the snapshot, took 47 mins for a 56GB hostd.db when creating the backup from SSD to the same SSD. From SSD to HDD took 56min. While this was happening, hostd ingress became reduced. Extrapolating this to a 300GB hostd.db, which is what I'd have if all my 35TB storage were used up, and this is rapidly becoming unviable, partly because of the time it takes, and also because, during this time, the performance of hostd is hit.
At the same time, to take a backup like this, you need twice the size of the db as free space before you start because a wal file is created first, then a db/bak file from the wal file, but the wal file is not deleted until after the db/bak file has been fully created.
Nate made a suggestion to remove the cache from the resulting backup. This needs free space the size of the backup. On an HDD, it takes way too long. On an SSD I was able to complete the suggestion in 130min on a 56GB backup which equates to about 12h on a 300GB backup.
The space requirements are becoming very expensive. The recommendation is 8GB/1TB stored on SSD. If you want backups, this goes up to 24GB/1TB stored, whether you strip the cache or not.
I'd like to propose a backup routine that exports all the critical data without the cache directly to a file. This should speed up the backups and massively reduce the space requirements and, hopefully, speed up the backups and reduce the effect of the performance degradation seen in hostd when backing up.
All reactions