cloudbase / garm

GitHub Actions Runner Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQLite file growing

SystemKeeper opened this issue · comments

I am wondering if we would need some method to shrink the SQLite database used by garm? (I think that's VACUUM on Sqlite?).

When I checked our database file on 5. October it was 937M in size, today it is at 1.15GB.

I think you're seeing this due to the fact that we had a few relations missing to instance status messages and jobs in version 0.1.3. This (I hope) is fixed in the main branch, but I still want to track down a few issues before I make a new release.

Quick way to test is to connect to the sqlite database:

sqlite3 /path/to/file.db

and just count the status messages:

SELECT COUNT(*) FROM instance_status_updates;

Chances are you have a lot of them. Feel free to remove them all, as they are only informational. Then you can VACUUM. In the next few weeks I plan to cut a new release which includes a ton of updates from 0.1.3.

The main branch already has a relation between instances and their status updates, so when instances get removed, so will the status updates, maintaining the database at a decent size.

sqlite> SELECT COUNT(*) FROM instance_status_updates;
2545815

but I noticed that we missed quite some updates on that machine, we're still at v0.1.0-38-g67b8714 of garm. I'll try to schedule some time to upgrade to the latest version!

Make sure to properly back up the database before you do. While I try to be careful with database upgrades, there is still a chance things may go wrong. A backup is always a good idea.

Updated to 0.1.3, removed all entries from instance_status_updates and executed VACUUM. Now the DB is at 268K. I'll monitor it the next couple of days and see how it works out :)

Version 0.1.3 might not have the proper DB relations set between the instances and status messages. I'll try to allocate some time to finish up a couple of things in current main and make another release. The next release will be a big one, with tons of updates, fixes and optimizations.

The latest RC1 release of GARM now has a proper relation set between the instance and status messages. When instances get removed, so will their status messages.

Take great care when updating (if you decide to do it). Make sure you back everything up. You may still need to remove old status messages yourself and execute a VACUUM.

Just a quick update, we are still on 0.1.3 at the moment and the DB has a size of 1.1 MB today, which is a really nice improvement to the size increase we were seeing before 👍

That is awesome! Thanks for the update!