satellite/dbcleanup: run cleanup more frequently
As the tables that get cleaned up by this job get a lot of inserts and deletes over the course of a day, the autovacuum process on PostgreSQL struggles fairly easily/quickly. Due to its limitation, it can only delete 180,000,000 tuples in one go, before it has to rescan the entire table/index. With the current load, the most busy satellites accumulate about 1,000,000,000 tuples per day (consumed_serials). With our current 24h interval that results in ~6-7 scans, slowing the entire database down for a quite long time. This PR reduces the interval to 4 hours, which under a constant load, results in less than 180,000,000 entries per run. That way, we do not scan twice for only a small gain over said amount. Reducing the interval further would also increase the DB load unnecessary, as each run scans the entire tables at least once. For future reference, we might need to adjust the interval, if the load is significantly changing. Change-Id: I18fdd45d93d468cff126e719c8380c29a49f43dd
This commit is contained in:
parent
26fce54b11
commit
c6c8b923af
@ -24,7 +24,7 @@ var (
|
||||
|
||||
// Config defines configuration struct for dbcleanup chore.
|
||||
type Config struct {
|
||||
SerialsInterval time.Duration `help:"how often to delete expired serial numbers" default:"24h"`
|
||||
SerialsInterval time.Duration `help:"how often to delete expired serial numbers" default:"4h"`
|
||||
}
|
||||
|
||||
// Chore for deleting DB entries that are no longer needed.
|
||||
|
2
scripts/testdata/satellite-config.yaml.lock
vendored
2
scripts/testdata/satellite-config.yaml.lock
vendored
@ -137,7 +137,7 @@ contact.external-address: ""
|
||||
# database-options.api-keys-cache.expiration: 1m0s
|
||||
|
||||
# how often to delete expired serial numbers
|
||||
# db-cleanup.serials-interval: 24h0m0s
|
||||
# db-cleanup.serials-interval: 4h0m0s
|
||||
|
||||
# Maximum Database Connection Lifetime, -1ns means the stdlib default
|
||||
# db.conn_max_lifetime: -1ns
|
||||
|
Loading…
Reference in New Issue
Block a user