mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 23:15:49 +03:00
[GH-ISSUE #556] SQLite vacuum is not called after purging #404
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#404
Loading…
Add table
Add a link
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?
Originally created by @OGKevin on GitHub (Aug 26, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/556
When using SQLite as the database, and you execute one of the purging commands, a lot of records are deleted but the disk usage remains the same.
I've just purged 1GB of data and had to manually execute vacuum to reclaim the disk space.
Is there a possibility to add a check, if DB is SQLlite, to execute vacuum after the purge? Happy to make a PR.
@cuu508 commented on GitHub (Aug 27, 2021):
Sounds good, happy to review a PR.
I think vacuuming should be optional, behind a flag:
Why make it optional and opt-in:
We will also need to document it in the README.
@idsvandermolen commented on GitHub (Oct 20, 2021):
I think operational databases in tools like this should not grow endlessly and certainly not as fast as this one with the pings. For now I implemented a work-around by adding these lines the
uwsgi.inifile (note we're running this in a container):The first line cleans up "pings" from the db and reclames disk space with sqlite
VACUUMcommand onuwsgistartup. The second line killsuwsgiafter an hour (which is automatically starting again).@cuu508 commented on GitHub (Oct 21, 2021):
uwsgi has cron-like interface, it lets you run commands on a regular interval.
Try something like this in
uwsgi.ini:@cuu508 commented on GitHub (Oct 21, 2021):
I just pushed a commit which adds automatic
api_pingandapi_notificationcleanup. And it removes theprunepings,prunepingsslowandprunenotificationsmanagement commands.The automatic cleanup happens when processing a received ping: after saving a ping to the database, Healthchecks now also removes old pings and notifications. But, to reduce overhead, it only does this every 100 received pings.
@idsvandermolen commented on GitHub (Oct 21, 2021):
@cuu508 Excellent! For reference, here's the commit
github.com/healthchecks/healthchecks@e1f51093f1