timescale / promscale

[DEPRECATED] Promscale is a unified metric and trace observability backend for Prometheus, Jaeger and OpenTelemetry built on PostgreSQL and TimescaleDB.
https://www.timescale.com/promscale
Apache License 2.0
1.33k stars 169 forks source link

Modify the vacuum engine to be more adaptive and use less CPU #1759

Closed jgpruitt closed 2 years ago

jgpruitt commented 2 years ago

Take the oldest age from the chunks to vacuum view let's call this AGE. if AGE < vacuum_freeze_min_age do nothing. Use the db vacuum_freeze_min_agesetting not the table setting (the table setting is 0). Hoping autovac takes care of things. if AGE > vacuum_freeze_min_age then linearly interpolate the AGE between vacuum_freeze_min_age and autovacuum_freeze_max_age and apply that interpolation to the number of vacuum workers so if AGE = vacuum_freeze_min_age use 1 worker and if AGE=`autovacuum_freeze_max_age use the max number of workers configured

Instead of using vacuum_freeze_min_age and autovacuum_freeze_max_age we can also have the min and max age configured through CLI options. Not sure what's better

jgpruitt commented 2 years ago

1761