lighthouse-ci
lighthouse-ci copied to clipboard
Builds clean up. Too much space taken
Hi, We are using lighthouse CI for quite long now. Is it possible to clean/remove old builds from database? We need last 2 months, other than that should be removed
Thanks!
This is an important feature in terms of administrating the CI server
this would be indeed very handy, since the database-size can grow very large very fast.
a manual workaround for now is to call these SQL-statemens on LHCI's SQLite database:
DELETE FROM statistics
WHERE createdAt < date('now', '-2 month')
DELETE FROM runs
WHERE createdAt < date('now', '-2 month')
DELETE FROM builds
WHERE createdAt < date('now', '-2 month')
you might have to compress the database afterwards to free up the space.
Actually, i just discovered, that this feature is already implemented. Take a look at the deleteOldBuildsCron
in the config.
Here's some more thoughts:
One run uses about 550kb disk space in the db. So if you have configured numberOfRuns
to 3 (which is the default for lhci --collect
calls), about 1.5mb is used. With psiCollectCron
the default numberOfRuns
is 5, resulting in 2.8mb per collection. If you want to monitor multiple sites/urls daily, this ramps up to the gigabytes very fast.
Of the 550kb of one run, the screenshots use about 360kb. So an option to exclude the screenshots from the result would dramatically decrease disk-usage.
Furthermore, it's questionable, if you need to keep all runs, since only one of them is marked as representative
and used in the UI anyway. A way to do this via SQL is described here.
Would be great if the deleteOldBuildsCron
had an option to filter those representative
when pruning.
Is there a way to delete screenshots of old builds instead of deleting them altogether? I'd prefer to keep the statistic data at low data cost.
Is there a way to delete screenshots of old builds instead of deleting them altogether? I'd prefer to keep the statistic data at low data cost.
Interested in this too - did you find a way?
Interested in this too - did you find a way?
No, unfortunately not.
some steps to manage the data base will also be helpful